Make backend and frontend work together

This commit is contained in:
rubikscraft
2022-02-23 21:06:07 +01:00
parent cba819b64d
commit b03f98a6b8
26 changed files with 259 additions and 85 deletions

View File

@@ -0,0 +1,38 @@
import {
IsBoolean,
IsNotEmpty,
IsOptional,
IsString,
ValidateNested,
} from 'class-validator';
import { User } from 'src/collections/userdb/user.dto';
export class LoginResponseDto {
@IsString()
access_token: string;
}
export class RegisterRequestDto {
@IsString()
@IsNotEmpty()
username: string;
@IsString()
@IsNotEmpty()
password: string;
@IsBoolean()
@IsOptional()
isAdmin?: boolean;
}
export class DeleteRequestDto {
@IsString()
@IsNotEmpty()
username: string;
}
export class JwtDataDto {
@ValidateNested()
user: User;
}