From 38f493ac5ade6bbe7ebacfe37ad9d5ffebf638bc Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Mon, 5 Dec 2022 16:54:15 +0100 Subject: [PATCH] refactor: run formatter --- backend/src/auth/dto/authRegister.dto.ts | 8 +++++--- backend/src/auth/dto/updatePassword.dto.ts | 2 +- backend/src/main.ts | 2 +- backend/src/user/dto/createUser.dto.ts | 7 ++++--- frontend/src/components/admin/showUpdateUserModal.tsx | 2 +- frontend/src/pages/account/index.tsx | 2 +- frontend/src/services/auth.service.ts | 2 +- frontend/src/types/user.type.ts | 4 ++-- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/backend/src/auth/dto/authRegister.dto.ts b/backend/src/auth/dto/authRegister.dto.ts index 1860cb4..b574a16 100644 --- a/backend/src/auth/dto/authRegister.dto.ts +++ b/backend/src/auth/dto/authRegister.dto.ts @@ -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) {} diff --git a/backend/src/auth/dto/updatePassword.dto.ts b/backend/src/auth/dto/updatePassword.dto.ts index 483ed84..8bfa991 100644 --- a/backend/src/auth/dto/updatePassword.dto.ts +++ b/backend/src/auth/dto/updatePassword.dto.ts @@ -5,4 +5,4 @@ import { UserDTO } from "src/user/dto/user.dto"; export class UpdatePasswordDTO extends PickType(UserDTO, ["password"]) { @IsString() oldPassword: string; -} \ No newline at end of file +} diff --git a/backend/src/main.ts b/backend/src/main.ts index 852eedf..20784f3 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -6,7 +6,7 @@ import { AppModule } from "./app.module"; async function bootstrap() { const app = await NestFactory.create(AppModule); - app.useGlobalPipes(new ValidationPipe({whitelist: true})); + app.useGlobalPipes(new ValidationPipe({ whitelist: true })); app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector))); app.set("trust proxy", true); diff --git a/backend/src/user/dto/createUser.dto.ts b/backend/src/user/dto/createUser.dto.ts index 785a1db..986502c 100644 --- a/backend/src/user/dto/createUser.dto.ts +++ b/backend/src/user/dto/createUser.dto.ts @@ -2,13 +2,14 @@ import { Expose, plainToClass } from "class-transformer"; import { Allow } from "class-validator"; import { UserDTO } from "./user.dto"; -export class CreateUserDTO extends UserDTO{ - +export class CreateUserDTO extends UserDTO { @Expose() @Allow() isAdmin: boolean; from(partial: Partial) { - return plainToClass(CreateUserDTO, partial, { excludeExtraneousValues: true }); + return plainToClass(CreateUserDTO, partial, { + excludeExtraneousValues: true, + }); } } diff --git a/frontend/src/components/admin/showUpdateUserModal.tsx b/frontend/src/components/admin/showUpdateUserModal.tsx index dd8f671..6ab363e 100644 --- a/frontend/src/components/admin/showUpdateUserModal.tsx +++ b/frontend/src/components/admin/showUpdateUserModal.tsx @@ -88,7 +88,7 @@ const Body = ({ mt="xs" labelPosition="left" label="Admin privileges" - {...accountForm.getInputProps("isAdmin", {type: "checkbox"})} + {...accountForm.getInputProps("isAdmin", { type: "checkbox" })} /> diff --git a/frontend/src/pages/account/index.tsx b/frontend/src/pages/account/index.tsx index 85e8927..5ee4312 100644 --- a/frontend/src/pages/account/index.tsx +++ b/frontend/src/pages/account/index.tsx @@ -58,7 +58,7 @@ const Account = () => { return ( - My account + My account diff --git a/frontend/src/services/auth.service.ts b/frontend/src/services/auth.service.ts index 9f4cba3..cf5610f 100644 --- a/frontend/src/services/auth.service.ts +++ b/frontend/src/services/auth.service.ts @@ -53,5 +53,5 @@ export default { signUp, signOut, refreshAccessToken, - updatePassword + updatePassword, }; diff --git a/frontend/src/types/user.type.ts b/frontend/src/types/user.type.ts index a4879a8..def08b7 100644 --- a/frontend/src/types/user.type.ts +++ b/frontend/src/types/user.type.ts @@ -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; };