refactor: run formatter
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
import { PickType } from "@nestjs/mapped-types";
|
import { PickType } from "@nestjs/mapped-types";
|
||||||
import { UserDTO } from "src/user/dto/user.dto";
|
import { UserDTO } from "src/user/dto/user.dto";
|
||||||
|
|
||||||
export class AuthRegisterDTO extends PickType(UserDTO, ["email", "username", "password"] as const) {
|
export class AuthRegisterDTO extends PickType(UserDTO, [
|
||||||
}
|
"email",
|
||||||
|
"username",
|
||||||
|
"password",
|
||||||
|
] as const) {}
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ import { Allow } from "class-validator";
|
|||||||
import { UserDTO } from "./user.dto";
|
import { UserDTO } from "./user.dto";
|
||||||
|
|
||||||
export class CreateUserDTO extends UserDTO {
|
export class CreateUserDTO extends UserDTO {
|
||||||
|
|
||||||
@Expose()
|
@Expose()
|
||||||
@Allow()
|
@Allow()
|
||||||
isAdmin: boolean;
|
isAdmin: boolean;
|
||||||
|
|
||||||
from(partial: Partial<CreateUserDTO>) {
|
from(partial: Partial<CreateUserDTO>) {
|
||||||
return plainToClass(CreateUserDTO, partial, { excludeExtraneousValues: true });
|
return plainToClass(CreateUserDTO, partial, {
|
||||||
|
excludeExtraneousValues: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,5 +53,5 @@ export default {
|
|||||||
signUp,
|
signUp,
|
||||||
signOut,
|
signOut,
|
||||||
refreshAccessToken,
|
refreshAccessToken,
|
||||||
updatePassword
|
updatePassword,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ type User = {
|
|||||||
export type CreateUser = {
|
export type CreateUser = {
|
||||||
username: string;
|
username: string;
|
||||||
email: string;
|
email: string;
|
||||||
password: string,
|
password: string;
|
||||||
isAdmin?: boolean;
|
isAdmin?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type UpdateUser = {
|
export type UpdateUser = {
|
||||||
username?: string;
|
username?: string;
|
||||||
email?: string;
|
email?: string;
|
||||||
password?: string,
|
password?: string;
|
||||||
isAdmin?: boolean;
|
isAdmin?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user