[questions][chore] update variable name

pull/330/head
hpkoh 3 years ago
parent cca2466edc
commit 257daa569c

@ -117,13 +117,13 @@ export const questionsQuestionCommentRouter = createProtectedRouter()
async resolve({ ctx, input }) { async resolve({ ctx, input }) {
const userId = ctx.session?.user?.id; const userId = ctx.session?.user?.id;
const questionCommentToUpdate = await ctx.prisma.questionsQuestionComment.findUnique({ const questionCommentToDelete = await ctx.prisma.questionsQuestionComment.findUnique({
where: { where: {
id: input.id, id: input.id,
}, },
}); });
if (questionCommentToUpdate?.id !== userId) { if (questionCommentToDelete?.id !== userId) {
throw new TRPCError({ throw new TRPCError({
code: 'UNAUTHORIZED', code: 'UNAUTHORIZED',
message: 'User have no authorization to record.', message: 'User have no authorization to record.',

Loading…
Cancel
Save