Fix job edits (#1811)

This commit is contained in:
ekzyis 2025-01-07 00:20:14 +01:00 committed by GitHub
parent 29c31e3d4a
commit c74107269d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1434,7 +1434,7 @@ export const updateItem = async (parent, { sub: subName, forward, hash, hmac, ..
// 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) || adminEdit || myBio || isJob(item)
const canEdit = (timer && ownerEdit) || adminEdit || myBio || isJob(old)
if (!canEdit) {
throw new GqlInputError('item can no longer be edited')
}