auth updating note id

This commit is contained in:
keyan 2023-12-19 12:31:24 -06:00
parent 5737027c0f
commit efd48afd61
1 changed files with 2 additions and 2 deletions

View File

@ -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 }
})