parent
99d8a0360f
commit
fcfc10f7d1
|
@ -3,5 +3,6 @@ dotenvSafe.config();
|
||||||
export const config = {
|
export const config = {
|
||||||
internal_port: process.env.APP_PORT || 4010,
|
internal_port: process.env.APP_PORT || 4010,
|
||||||
development: process.env.NODE_ENV === "production",
|
development: process.env.NODE_ENV === "production",
|
||||||
jwt_secret: process.env.JWT_SECRET || "secretjwtsecret"
|
jwt_secret: process.env.JWT_SECRET || "secretjwtsecret",
|
||||||
|
phone_validation_countrycode: process.env.PHONE_COUNTRYCODE || "ZZ"
|
||||||
}
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
import { IsEmail, IsInt, IsNotEmpty, IsOptional, IsPhoneNumber, IsString } from 'class-validator';
|
import { IsEmail, IsInt, IsNotEmpty, IsOptional, IsPhoneNumber, IsString } from 'class-validator';
|
||||||
import { getConnectionManager } from 'typeorm';
|
import { getConnectionManager } from 'typeorm';
|
||||||
|
import { config } from '../../config';
|
||||||
import { AddressNotFoundError, AddressWrongTypeError } from '../../errors/AddressErrors';
|
import { AddressNotFoundError, AddressWrongTypeError } from '../../errors/AddressErrors';
|
||||||
import { Address } from '../entities/Address';
|
import { Address } from '../entities/Address';
|
||||||
import { GroupContact } from '../entities/GroupContact';
|
import { GroupContact } from '../entities/GroupContact';
|
||||||
|
@ -40,7 +41,7 @@ export class CreateGroupContact {
|
||||||
* Optional
|
* Optional
|
||||||
*/
|
*/
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsPhoneNumber("DE")
|
@IsPhoneNumber(config.phone_validation_countrycode)
|
||||||
phone?: string;
|
phone?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
IsString
|
IsString
|
||||||
} from "class-validator";
|
} from "class-validator";
|
||||||
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||||
|
import { config } from '../../config';
|
||||||
import { Address } from "./Address";
|
import { Address } from "./Address";
|
||||||
import { RunnerGroup } from "./RunnerGroup";
|
import { RunnerGroup } from "./RunnerGroup";
|
||||||
|
|
||||||
|
@ -62,7 +63,7 @@ export class GroupContact {
|
||||||
*/
|
*/
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsPhoneNumber("DE")
|
@IsPhoneNumber(config.phone_validation_countrycode)
|
||||||
phone?: string;
|
phone?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
IsString
|
IsString
|
||||||
} from "class-validator";
|
} from "class-validator";
|
||||||
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn, TableInheritance } from "typeorm";
|
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn, TableInheritance } from "typeorm";
|
||||||
|
import { config } from '../../config';
|
||||||
import { Address } from "./Address";
|
import { Address } from "./Address";
|
||||||
import { Donation } from "./Donation";
|
import { Donation } from "./Donation";
|
||||||
|
|
||||||
|
@ -62,7 +63,7 @@ export abstract class Participant {
|
||||||
*/
|
*/
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsPhoneNumber("DE")
|
@IsPhoneNumber(config.phone_validation_countrycode)
|
||||||
phone?: string;
|
phone?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user