Skip to content

Commit e011fba

Browse files
authored
Update README and questionController.ts (#42)
- README: Update details on getTopics - questionController: Remove if check on getTopics
1 parent 0db5a22 commit e011fba

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

services/question/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
```cmd
88
cp .env.sample .env
9-
cp services/question/.env.sample services/question/.env
109
```
1110

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

253251
### Command Line Example:

services/question/src/controllers/questionController.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ export const getTopics = async (req: Request, res: Response) => {
129129
try {
130130
const topics = await Question.distinct('topics');
131131

132-
if (!topics || topics.length === 0) {
133-
return handleNotFound(res, 'No topics found');
134-
}
135-
136132
handleSuccess(res, 200, 'Topics retrieved successfully', topics);
137133
} catch (error) {
138134
console.error('Error in getTopics:', error);

0 commit comments

Comments
 (0)