Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Fix on Question Service #42

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions services/question/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

```cmd
cp .env.sample .env
cp services/question/.env.sample services/question/.env
```

2. After setting up the .env files, build the Docker images and start the containers using the following command:
Expand Down Expand Up @@ -247,7 +246,6 @@ This endpoint retrieves all unique topics in the database
| Response Code | Explanation |
|-----------------------------|---------------------------------------------------------------------|
| 200 (OK) | Success, all topics are returned. |
| 404 (Not Found) | No topic found. |
| 500 (Internal Server Error) | The server encountered an error and could not complete the request. |

### Command Line Example:
Expand Down
4 changes: 0 additions & 4 deletions services/question/src/controllers/questionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ export const getTopics = async (req: Request, res: Response) => {
try {
const topics = await Question.distinct('topics');

if (!topics || topics.length === 0) {
return handleNotFound(res, 'No topics found');
}

handleSuccess(res, 200, 'Topics retrieved successfully', topics);
} catch (error) {
console.error('Error in getTopics:', error);
Expand Down