Skip to content

Commit

Permalink
Update README and questionController.ts (#42)
Browse files Browse the repository at this point in the history
- README: Update details on getTopics
- questionController: Remove if check on getTopics
  • Loading branch information
KhoonSun47 authored Sep 28, 2024
1 parent 0db5a22 commit e011fba
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
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

0 comments on commit e011fba

Please sign in to comment.