From efd48afd6169c0a7adc2ea26b036b5301655d61c Mon Sep 17 00:00:00 2001 From: keyan Date: Tue, 19 Dec 2023 12:31:24 -0600 Subject: [PATCH] auth updating note id --- api/resolvers/item.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/resolvers/item.js b/api/resolvers/item.js index 6dc78033..dcbf58fa 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -724,13 +724,13 @@ export default { return item } }, - updateNoteId: async (parent, { id, noteId }, { models }) => { + updateNoteId: async (parent, { id, noteId }, { me, models }) => { if (!id) { throw new GraphQLError('id required', { extensions: { code: 'BAD_INPUT' } }) } await models.item.update({ - where: { id: Number(id) }, + where: { id: Number(id), userId: Number(me.id) }, data: { noteId } })