From 28c8e394151703b22d74f2ac649ff0b2133e1a7a Mon Sep 17 00:00:00 2001 From: Louis Auzuret Date: Mon, 20 Jun 2022 15:47:35 +0200 Subject: [PATCH] feat: auth dtos --- back/src/auth/dto/login.dto.ts | 12 ++++++++++++ back/src/auth/dto/register.dto.ts | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 back/src/auth/dto/login.dto.ts create mode 100644 back/src/auth/dto/register.dto.ts diff --git a/back/src/auth/dto/login.dto.ts b/back/src/auth/dto/login.dto.ts new file mode 100644 index 0000000..78d3526 --- /dev/null +++ b/back/src/auth/dto/login.dto.ts @@ -0,0 +1,12 @@ +import { IsNotEmpty } from "class-validator"; +import { ApiProperty } from '@nestjs/swagger'; + +export class LoginDto { + @ApiProperty() + @IsNotEmpty() + password: string; + + @ApiProperty() + @IsNotEmpty() + username: string; +} diff --git a/back/src/auth/dto/register.dto.ts b/back/src/auth/dto/register.dto.ts new file mode 100644 index 0000000..d8dd9a8 --- /dev/null +++ b/back/src/auth/dto/register.dto.ts @@ -0,0 +1,16 @@ +import { IsNotEmpty } from "class-validator"; +import { ApiProperty } from '@nestjs/swagger'; + +export class RegisterDto { + @ApiProperty() + @IsNotEmpty() + password: string; + + @IsNotEmpty() + @ApiProperty() + username: string; + + @IsNotEmpty() + @ApiProperty() + email: string; +}