1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-07-02 07:20:38 +02:00

refactor: run formatter

This commit is contained in:
Elias Schneider 2022-12-05 16:54:15 +01:00
parent 0499548dd3
commit 38f493ac5a
8 changed files with 16 additions and 13 deletions

View File

@ -1,6 +1,8 @@
import { PickType } from "@nestjs/mapped-types";
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) {}

View File

@ -3,12 +3,13 @@ import { Allow } from "class-validator";
import { UserDTO } from "./user.dto";
export class CreateUserDTO extends UserDTO {
@Expose()
@Allow()
isAdmin: boolean;
from(partial: Partial<CreateUserDTO>) {
return plainToClass(CreateUserDTO, partial, { excludeExtraneousValues: true });
return plainToClass(CreateUserDTO, partial, {
excludeExtraneousValues: true,
});
}
}

View File

@ -53,5 +53,5 @@ export default {
signUp,
signOut,
refreshAccessToken,
updatePassword
updatePassword,
};

View File

@ -8,14 +8,14 @@ type User = {
export type CreateUser = {
username: string;
email: string;
password: string,
password: string;
isAdmin?: boolean;
};
export type UpdateUser = {
username?: string;
email?: string;
password?: string,
password?: string;
isAdmin?: boolean;
};