mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Add error to confirmContribution mutation in case where contributionState is 'DENIED'
This commit is contained in:
parent
2e9f8caa9d
commit
605812d777
@ -561,6 +561,10 @@ export class ContributionResolver {
|
|||||||
logger.error(`Contribution not found for given id: ${id}`)
|
logger.error(`Contribution not found for given id: ${id}`)
|
||||||
throw new Error('Contribution not found to given id.')
|
throw new Error('Contribution not found to given id.')
|
||||||
}
|
}
|
||||||
|
if (contribution.contributionStatus === 'DENIED') {
|
||||||
|
logger.error(`Contribution state (${contribution.contributionStatus}) can't be confirmed`)
|
||||||
|
throw new Error("Contribution state can't be confirmed")
|
||||||
|
}
|
||||||
const moderatorUser = getUser(context)
|
const moderatorUser = getUser(context)
|
||||||
if (moderatorUser.id === contribution.userId) {
|
if (moderatorUser.id === contribution.userId) {
|
||||||
logger.error('Moderator can not confirm own contribution')
|
logger.error('Moderator can not confirm own contribution')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user