From fa3fd9e1bd196540daab29de0333e38a7730bed4 Mon Sep 17 00:00:00 2001 From: Lawrence Kang Date: Fri, 16 Aug 2019 12:36:58 -0700 Subject: [PATCH] clarify variable name: linkExists -> voteExists --- src/resolvers/Mutation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resolvers/Mutation.js b/src/resolvers/Mutation.js index ad52b84..05184b3 100644 --- a/src/resolvers/Mutation.js +++ b/src/resolvers/Mutation.js @@ -44,11 +44,11 @@ async function login(parent, args, context, info) { async function vote(parent, args, context, info) { const userId = getUserId(context) - const linkExists = await context.prisma.$exists.vote({ + const voteExists = await context.prisma.$exists.vote({ user: { id: userId }, link: { id: args.linkId }, }) - if (linkExists) { + if (voteExists) { throw new Error(`Already voted for link: ${args.linkId}`) }