Implemented deep address validation

ref #105
This commit is contained in:
niggl committed 2021-01-16 20:12:17 +01:00
1 parent f245840cde
commit 9dc9ce37d8
9 files changed
+83 -2

No files matched your search

@@ -3,6 +3,7 @@ import { getConnectionManager } from 'typeorm';
import { RunnerGroupNotFoundError } from '../../../errors/RunnerGroupErrors';
import { RunnerOrganisationWrongTypeError } from '../../../errors/RunnerOrganisationErrors';
import { RunnerTeamNeedsParentError } from '../../../errors/RunnerTeamErrors';
import { Address } from '../../entities/Address';
import { Runner } from '../../entities/Runner';
import { RunnerGroup } from '../../entities/RunnerGroup';
import { CreateParticipant } from './CreateParticipant';
@@ -31,6 +32,7 @@ export class CreateRunner extends CreateParticipant {
newRunner.email = this.email;
newRunner.group = await this.getGroup();
newRunner.address = this.address;
Address.validate(newRunner.address);
return newRunner;
}