Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/resolvers/Mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}

Expand Down