Throw error if confirmedAt is present.

This commit is contained in:
elweyn 2022-07-19 13:09:03 +02:00
parent d5a2c24d7e
commit b4a4a9e126

View File

@ -52,6 +52,9 @@ export class ContributionResolver {
if (contribution.userId !== user.id) {
throw new Error('Can not delete contribution of another user')
}
if (contribution.confirmedAt) {
throw new Error('A confirmed contribution can not be deleted')
}
const res = await contribution.softRemove()
return !!res
}