diff --git a/api/resolvers/item.js b/api/resolvers/item.js index cd65ff84..2f0676a9 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -1381,10 +1381,11 @@ export const updateItem = async (parent, { sub: subName, forward, hash, hmac, .. const user = await models.user.findUnique({ where: { id: meId } }) - // edits are only allowed for own items within 10 minutes but forever if it's their bio or a job + // edits are only allowed for own items within 10 minutes + // but forever if an admin is editing an "admin item", it's their bio or a job const myBio = user.bioId === old.id const timer = Date.now() < datePivot(new Date(old.invoicePaidAt ?? old.createdAt), { seconds: ITEM_EDIT_SECONDS }) - const canEdit = (timer && ownerEdit) || myBio || isJob(item) + const canEdit = (timer && ownerEdit) || adminEdit || myBio || isJob(item) if (!canEdit) { throw new GqlInputError('item can no longer be edited') }