From 6763ef7bf046a7680a9949419a6fbbc02f94a629 Mon Sep 17 00:00:00 2001 From: keyan Date: Sun, 10 Dec 2023 19:26:25 -0600 Subject: [PATCH] fix comment edit bug --- api/resolvers/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/resolvers/item.js b/api/resolvers/item.js index f936c3f7..4800c0b0 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -1059,7 +1059,7 @@ export const updateItem = async (parent, { sub: subName, forward, options, ...it if (Number(old.userId) !== Number(me?.id)) { throw new GraphQLError('item does not belong to you', { extensions: { code: 'FORBIDDEN' } }) } - if (old.subName !== subName) { + if (subName && old.subName !== subName) { const sub = await models.sub.findUnique({ where: { name: subName } }) if (old.freebie) { if (!sub.allowFreebies) {