Skip to content

Commit 66d756a

Browse files
committed
Fix bug in get attempted qns EP
Signed-off-by: SeeuSim <[email protected]>
1 parent b3019c7 commit 66d756a

File tree

1 file changed

+2
-2
lines changed
  • backend/user/src/services/questions

1 file changed

+2
-2
lines changed

backend/user/src/services/questions/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const addAttemptedQuestionService = async (
2525
const userRecords = await db
2626
.select({ id: users.id, attemptedQuestions: users.attemptedQuestions })
2727
.from(users)
28-
.where(sql`${users.username} = ANY(${userIds})`);
28+
.where(sql`${users.id} = ANY(${userIds})`);
2929

3030
if (userRecords.length === 0) {
3131
return {
@@ -72,7 +72,7 @@ export const getAttemptedQuestionsService = async (
7272
const result = await db
7373
.select({ attemptedQuestions: users.attemptedQuestions })
7474
.from(users)
75-
.where(eq(users.username, userId))
75+
.where(eq(users.id, userId))
7676
.limit(1);
7777

7878
if (result.length === 0) {

0 commit comments

Comments
 (0)