mirror of
https://gitlab.com/mobicoop/v3/service/user.git
synced 2026-01-09 23:52:41 +00:00
add custom validation pipe
This commit is contained in:
@@ -1,24 +1,29 @@
|
||||
import { AutoMap } from '@automapper/classes';
|
||||
import { IsString } from 'class-validator';
|
||||
import { IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class CreateUserRequest {
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@AutoMap()
|
||||
uuid?: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@AutoMap()
|
||||
firstName?: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@AutoMap()
|
||||
lastName?: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@AutoMap()
|
||||
email?: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@AutoMap()
|
||||
phone?: string;
|
||||
}
|
||||
|
||||
@@ -1,24 +1,35 @@
|
||||
import { AutoMap } from '@automapper/classes';
|
||||
import { IsString } from 'class-validator';
|
||||
import {
|
||||
IsEmail,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsPhoneNumber,
|
||||
IsString,
|
||||
} from 'class-validator';
|
||||
|
||||
export class UpdateUserRequest {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@AutoMap()
|
||||
uuid: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@AutoMap()
|
||||
firstName?: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@AutoMap()
|
||||
lastName?: string;
|
||||
|
||||
@IsString()
|
||||
@IsEmail()
|
||||
@IsOptional()
|
||||
@AutoMap()
|
||||
email?: string;
|
||||
|
||||
@IsString()
|
||||
@IsPhoneNumber()
|
||||
@IsOptional()
|
||||
@AutoMap()
|
||||
phone?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user