From 68be43212cf70809b9dfe0741bfbb116b507787b Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Tue, 14 Nov 2023 12:06:06 +0100 Subject: [PATCH] put back restriction for date editing in backend, because frontend currently not support it --- .../UnconfirmedContribution.role.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/src/interactions/updateUnconfirmedContribution/UnconfirmedContribution.role.ts b/backend/src/interactions/updateUnconfirmedContribution/UnconfirmedContribution.role.ts index b4926a640..fc822c41c 100644 --- a/backend/src/interactions/updateUnconfirmedContribution/UnconfirmedContribution.role.ts +++ b/backend/src/interactions/updateUnconfirmedContribution/UnconfirmedContribution.role.ts @@ -25,6 +25,11 @@ export abstract class UnconfirmedContributionRole { protected abstract checkAuthorization(user: User, role: Role): void // second, check if contribution is still valid after update protected async validate(clientTimezoneOffset: number): Promise { + // TODO: refactor frontend and remove this restriction + if (this.self.contributionDate.getMonth() !== this.updatedCreationDate.getMonth()) { + throw new LogError('Month of contribution can not be changed') + } + const contributionLogic = new ContributionLogic(this.self) this.availableCreationSums = await contributionLogic.getAvailableCreationSums( clientTimezoneOffset,