fix comment edit bug

This commit is contained in:
keyan 2023-12-10 19:26:25 -06:00
parent fbacf1ac63
commit 6763ef7bf0
1 changed files with 1 additions and 1 deletions

View File

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