Implemented deep address validation

ref #105
This commit is contained in:
2021-01-16 20:12:17 +01:00
parent f245840cde
commit 9dc9ce37d8
9 changed files with 83 additions and 2 deletions

View File

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