File tree 2 files changed +7
-24
lines changed
2 files changed +7
-24
lines changed Original file line number Diff line number Diff line change @@ -12,18 +12,6 @@ export const getAnswer = async (opts: {
12
12
} ) => {
13
13
const { questionUid } = opts ;
14
14
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
-
27
15
try {
28
16
// find the answer to the question
29
17
return await prisma . questionAnswers . findFirst ( {
Original file line number Diff line number Diff line change @@ -17,16 +17,11 @@ export const getUserAnswer = async (opts: { questionUid: string }) => {
17
17
return false ;
18
18
}
19
19
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
+ } ) ;
32
27
} ;
You can’t perform that action at this time.
0 commit comments