parent
0fc0b87c67
commit
4cfe9df429
@ -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';
|
||||||
|
|
||||||
@ -32,7 +33,7 @@ export abstract class CreateParticipant {
|
|||||||
*/
|
*/
|
||||||
@IsString()
|
@IsString()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsPhoneNumber("ZZ")
|
@IsPhoneNumber(config.phone_validation_countrycode)
|
||||||
phone?: string;
|
phone?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,6 +2,7 @@ import * as argon2 from "argon2";
|
|||||||
import { IsEmail, IsOptional, IsPhoneNumber, IsString } from 'class-validator';
|
import { IsEmail, IsOptional, IsPhoneNumber, IsString } from 'class-validator';
|
||||||
import { getConnectionManager } from 'typeorm';
|
import { getConnectionManager } from 'typeorm';
|
||||||
import * as uuid from 'uuid';
|
import * as uuid from 'uuid';
|
||||||
|
import { config } from '../../config';
|
||||||
import { UsernameOrEmailNeededError } from '../../errors/UserErrors';
|
import { UsernameOrEmailNeededError } from '../../errors/UserErrors';
|
||||||
import { UserGroupNotFoundError } from '../../errors/UserGroupErrors';
|
import { UserGroupNotFoundError } from '../../errors/UserGroupErrors';
|
||||||
import { User } from '../entities/User';
|
import { User } from '../entities/User';
|
||||||
@ -49,7 +50,7 @@ export class CreateUser {
|
|||||||
* The new user's phone number.
|
* The new user's phone number.
|
||||||
* Optional
|
* Optional
|
||||||
*/
|
*/
|
||||||
@IsPhoneNumber("ZZ")
|
@IsPhoneNumber(config.phone_validation_countrycode)
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
phone?: string;
|
phone?: string;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { IsBoolean, IsEmail, IsInt, IsNotEmpty, IsOptional, IsPhoneNumber, IsString, IsUUID } from "class-validator";
|
import { IsBoolean, IsEmail, IsInt, IsNotEmpty, IsOptional, IsPhoneNumber, IsString, IsUUID } from "class-validator";
|
||||||
import { Column, Entity, JoinTable, ManyToMany, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
import { Column, Entity, JoinTable, ManyToMany, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||||
|
import { config } from '../../config';
|
||||||
import { Permission } from './Permission';
|
import { Permission } from './Permission';
|
||||||
import { UserAction } from './UserAction';
|
import { UserAction } from './UserAction';
|
||||||
import { UserGroup } from './UserGroup';
|
import { UserGroup } from './UserGroup';
|
||||||
@ -35,7 +36,7 @@ export class User {
|
|||||||
*/
|
*/
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true })
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsPhoneNumber("ZZ")
|
@IsPhoneNumber(config.phone_validation_countrycode)
|
||||||
phone?: string;
|
phone?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user