put back restriction for date editing in backend, because frontend currently not support it

This commit is contained in:
einhornimmond 2023-11-14 12:06:06 +01:00
parent 140349a6e0
commit 68be43212c

View File

@ -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<void> {
// 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,