fix: deny zaps for deleted items (#1158)

This commit is contained in:
Abhi Shandilya 2024-05-11 22:00:08 -04:00 committed by GitHub
parent 0fda8907e7
commit 512b08997e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -866,6 +866,10 @@ export default {
FROM "Item" FROM "Item"
WHERE id = $1`, Number(id)) WHERE id = $1`, Number(id))
if (item.deletedAt) {
throw new GraphQLError('item is deleted', { extensions: { code: 'BAD_INPUT' } })
}
// disallow self tips except anons // disallow self tips except anons
if (me) { if (me) {
if (Number(item.userId) === Number(me.id)) { if (Number(item.userId) === Number(me.id)) {