Skip to content

Commit

Permalink
fix comment edit bug
Browse files Browse the repository at this point in the history
  • Loading branch information
huumn committed Dec 11, 2023
1 parent fbacf1a commit 6763ef7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/resolvers/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6763ef7

Please sign in to comment.