[questions][chore] update var name

pull/327/head
hpkoh 3 years ago
parent 95c77e610f
commit 529e93caff

@ -135,13 +135,13 @@ export const questionsQuestionsRouter = createProtectedRouter()
async resolve({ ctx, input }) { async resolve({ ctx, input }) {
const userId = ctx.session?.user?.id; const userId = ctx.session?.user?.id;
const questionToUpdate = await ctx.prisma.questionsQuestion.findUnique({ const questionToDelete = await ctx.prisma.questionsQuestion.findUnique({
where: { where: {
id: input.id, id: input.id,
}, },
}); });
if (questionToUpdate?.id !== userId) { if (questionToDelete?.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