fix comment edit bug
This commit is contained in:
parent
fbacf1ac63
commit
6763ef7bf0
|
@ -1059,7 +1059,7 @@ export const updateItem = async (parent, { sub: subName, forward, options, ...it
|
||||||
if (Number(old.userId) !== Number(me?.id)) {
|
if (Number(old.userId) !== Number(me?.id)) {
|
||||||
throw new GraphQLError('item does not belong to you', { extensions: { code: 'FORBIDDEN' } })
|
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 } })
|
const sub = await models.sub.findUnique({ where: { name: subName } })
|
||||||
if (old.freebie) {
|
if (old.freebie) {
|
||||||
if (!sub.allowFreebies) {
|
if (!sub.allowFreebies) {
|
||||||
|
|
Loading…
Reference in New Issue