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