2022-02-21 14:53:21 +01:00
|
|
|
import {
|
|
|
|
|
IsBoolean,
|
|
|
|
|
IsNotEmpty,
|
|
|
|
|
IsOptional,
|
|
|
|
|
IsString,
|
|
|
|
|
ValidateNested,
|
|
|
|
|
} from 'class-validator';
|
2022-02-21 22:36:47 +01:00
|
|
|
import { User } from 'src/collections/userdb/user.dto';
|
2022-02-21 14:53:21 +01:00
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|