first commit
This commit is contained in:
34
myteamwallet_backend/src/auth/dto/auth-update.dto.ts
Normal file
34
myteamwallet_backend/src/auth/dto/auth-update.dto.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsOptional, MinLength, Validate } from 'class-validator';
|
||||
import { IsExist } from '../../utils/validators/is-exists.validator';
|
||||
import { FileEntity } from '../../files/entities/file.entity';
|
||||
|
||||
export class AuthUpdateDto {
|
||||
@ApiProperty({ type: () => FileEntity })
|
||||
@IsOptional()
|
||||
@Validate(IsExist, ['FileEntity', 'id'], {
|
||||
message: 'imageNotExists',
|
||||
})
|
||||
photo?: FileEntity;
|
||||
|
||||
@ApiProperty({ example: 'John' })
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: 'mustBeNotEmpty' })
|
||||
firstName?: string;
|
||||
|
||||
@ApiProperty({ example: 'Doe' })
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: 'mustBeNotEmpty' })
|
||||
lastName?: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsOptional()
|
||||
@IsNotEmpty()
|
||||
@MinLength(6)
|
||||
password?: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: 'mustBeNotEmpty' })
|
||||
oldPassword: string;
|
||||
}
|
||||
Reference in New Issue
Block a user