Skip to content

Commit bea250e

Browse files
committed
explore hotfix
1 parent 3ec709e commit bea250e

File tree

2 files changed

+7
-24
lines changed

2 files changed

+7
-24
lines changed

src/utils/data/answers/get-answer.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@ export const getAnswer = async (opts: {
1212
}) => {
1313
const { questionUid } = opts;
1414

15-
// check if the user has answered the question
16-
// const userHasAnswered = await prisma.answers.findFirst({
17-
// where: {
18-
// userUid,
19-
// questionUid,
20-
// },
21-
// });
22-
23-
// if (!userHasAnswered) {
24-
// throw new Error('User has not answered this question');
25-
// }
26-
2715
try {
2816
// find the answer to the question
2917
return await prisma.questionAnswers.findFirst({

src/utils/data/answers/get-user-answer.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@ export const getUserAnswer = async (opts: { questionUid: string }) => {
1717
return false;
1818
}
1919

20-
try {
21-
// find the answer to the question
22-
return await prisma.answers.findFirst({
23-
where: {
24-
questionUid,
25-
userUid: user?.uid,
26-
},
27-
});
28-
} catch (error) {
29-
console.error(error);
30-
throw new Error('Error getting user answer');
31-
}
20+
// find the answer to the question
21+
return await prisma.answers.findFirst({
22+
where: {
23+
questionUid,
24+
userUid: user?.uid,
25+
},
26+
});
3227
};

0 commit comments

Comments
 (0)