Throw error if moderator tries to answer his own contribution in adminCreateContributionMessage.

This commit is contained in:
elweyn 2022-09-06 10:39:20 +02:00
parent 915cf4fcf1
commit 04b96bac2f

View File

@ -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