phone countrycode validation in env vars

ref #18 #16
This commit is contained in:
2020-12-06 11:21:10 +01:00
parent 99d8a0360f
commit fcfc10f7d1
4 changed files with 8 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ import {
IsString
} from "class-validator";
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn, TableInheritance } from "typeorm";
import { config } from '../../config';
import { Address } from "./Address";
import { Donation } from "./Donation";
@@ -62,7 +63,7 @@ export abstract class Participant {
*/
@Column({ nullable: true })
@IsOptional()
@IsPhoneNumber("DE")
@IsPhoneNumber(config.phone_validation_countrycode)
phone?: string;
/**