forked from Ynov/ptitspas-ynov-back
create user-dto
This commit is contained in:
parent
3633b88902
commit
57f2026ac8
@ -8,7 +8,7 @@ import {
|
|||||||
IsOptional,
|
IsOptional,
|
||||||
IsString,
|
IsString,
|
||||||
MinLength,
|
MinLength,
|
||||||
MaxLength
|
MaxLength,
|
||||||
} from 'class-validator';
|
} from 'class-validator';
|
||||||
import { RoleType, GenreType, StatutUtilisateurType } from 'src/entities/users.entity';
|
import { RoleType, GenreType, StatutUtilisateurType } from 'src/entities/users.entity';
|
||||||
|
|
||||||
@ -18,10 +18,7 @@ export class CreateUserDto {
|
|||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
email: string;
|
email: string;
|
||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({ minLength: 6 })
|
||||||
minLength: 6,
|
|
||||||
description: 'Mot de passe en clair (hashé côté serveur)'
|
|
||||||
})
|
|
||||||
@IsString()
|
@IsString()
|
||||||
@MinLength(6)
|
@MinLength(6)
|
||||||
password: string;
|
password: string;
|
||||||
@ -43,9 +40,9 @@ export class CreateUserDto {
|
|||||||
@IsEnum(GenreType)
|
@IsEnum(GenreType)
|
||||||
gender?: GenreType = GenreType.AUTRE;
|
gender?: GenreType = GenreType.AUTRE;
|
||||||
|
|
||||||
@ApiProperty({ enum: RoleType, default: RoleType.PARENT })
|
@ApiProperty({ enum: RoleType })
|
||||||
@IsEnum(RoleType)
|
@IsEnum(RoleType)
|
||||||
role: RoleType = RoleType.PARENT;
|
role: RoleType;
|
||||||
|
|
||||||
@ApiProperty({ enum: StatutUtilisateurType, required: false, default: StatutUtilisateurType.EN_ATTENTE })
|
@ApiProperty({ enum: StatutUtilisateurType, required: false, default: StatutUtilisateurType.EN_ATTENTE })
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user