From 62cef77fbd8fb17107876e0afb4ef97aad85a923 Mon Sep 17 00:00:00 2001 From: hpkoh Date: Sun, 9 Oct 2022 11:06:12 +0800 Subject: [PATCH] [questions][chore] update var name --- .../src/server/router/questions-answer-comment-router.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/portal/src/server/router/questions-answer-comment-router.ts b/apps/portal/src/server/router/questions-answer-comment-router.ts index e86597bc..a344d909 100644 --- a/apps/portal/src/server/router/questions-answer-comment-router.ts +++ b/apps/portal/src/server/router/questions-answer-comment-router.ts @@ -88,13 +88,13 @@ export const questionsAnswerCommentRouter = createProtectedRouter() async resolve({ ctx, input }) { const userId = ctx.session?.user?.id; - const questionCommentToUpdate = await ctx.prisma.questionsAnswerComment.findUnique({ + const answerCommentToUpdate = await ctx.prisma.questionsAnswerComment.findUnique({ where: { id: input.id, }, }); - if (questionCommentToUpdate?.id !== userId) { + if (answerCommentToUpdate?.id !== userId) { throw new TRPCError({ code: 'UNAUTHORIZED', message: 'User have no authorization to record.', @@ -118,13 +118,13 @@ export const questionsAnswerCommentRouter = createProtectedRouter() async resolve({ ctx, input }) { const userId = ctx.session?.user?.id; - const questionCommentToUpdate = await ctx.prisma.questionsAnswerComment.findUnique({ + const answerCommentToDelete = await ctx.prisma.questionsAnswerComment.findUnique({ where: { id: input.id, }, }); - if (questionCommentToUpdate?.id !== userId) { + if (answerCommentToDelete?.id !== userId) { throw new TRPCError({ code: 'UNAUTHORIZED', message: 'User have no authorization to record.',