Skip to content

Commit 1573e76

Browse files
committed
Refactor question service to use number instead of string for question ID
1 parent 61198af commit 1573e76

File tree

1 file changed

+2
-2
lines changed
  • backend/question/src/services/post

1 file changed

+2
-2
lines changed

backend/question/src/services/post/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const updateQuestionService = async (payload: IUpdateQuestionPayload) =>
3232
difficulty: payload.difficulty,
3333
topic: payload.topics.map(String),
3434
})
35-
.where(eq(questions.id, String(payload.id)))
35+
.where(eq(questions.id, Number(payload.id)))
3636
.returning();
3737

3838
if (!updatedQuestion) {
@@ -50,7 +50,7 @@ export const deleteQuestionService = async (payload: IDeleteQuestionPayload) =>
5050
try {
5151
const [deletedQuestion] = await db
5252
.delete(questions)
53-
.where(eq(questions.id, String(payload.id)))
53+
.where(eq(questions.id, payload.id))
5454
.returning();
5555

5656
if (!deletedQuestion) {

0 commit comments

Comments
 (0)