mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Throw error if moderator tries to answer his own contribution in adminCreateContributionMessage.
This commit is contained in:
parent
915cf4fcf1
commit
04b96bac2f
@ -717,6 +717,9 @@ export class AdminResolver {
|
||||
if (!contribution) {
|
||||
throw new Error('Contribution not found')
|
||||
}
|
||||
if (contribution.userId === user.id) {
|
||||
throw new Error('Can not answer on own contribution')
|
||||
}
|
||||
contributionMessage.contributionId = contributionId
|
||||
contributionMessage.createdAt = new Date()
|
||||
contributionMessage.message = message
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user