mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
refactor: run formatter
This commit is contained in:
parent
0499548dd3
commit
38f493ac5a
8 changed files with 16 additions and 13 deletions
|
@ -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) {}
|
||||||
|
|
|
@ -5,4 +5,4 @@ import { UserDTO } from "src/user/dto/user.dto";
|
||||||
export class UpdatePasswordDTO extends PickType(UserDTO, ["password"]) {
|
export class UpdatePasswordDTO extends PickType(UserDTO, ["password"]) {
|
||||||
@IsString()
|
@IsString()
|
||||||
oldPassword: string;
|
oldPassword: string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { AppModule } from "./app.module";
|
||||||
|
|
||||||
async function bootstrap() {
|
async function bootstrap() {
|
||||||
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
const app = await NestFactory.create<NestExpressApplication>(AppModule);
|
||||||
app.useGlobalPipes(new ValidationPipe({whitelist: true}));
|
app.useGlobalPipes(new ValidationPipe({ whitelist: true }));
|
||||||
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));
|
app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector)));
|
||||||
|
|
||||||
app.set("trust proxy", true);
|
app.set("trust proxy", true);
|
||||||
|
|
|
@ -2,13 +2,14 @@ import { Expose, plainToClass } from "class-transformer";
|
||||||
import { Allow } from "class-validator";
|
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,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ const Body = ({
|
||||||
mt="xs"
|
mt="xs"
|
||||||
labelPosition="left"
|
labelPosition="left"
|
||||||
label="Admin privileges"
|
label="Admin privileges"
|
||||||
{...accountForm.getInputProps("isAdmin", {type: "checkbox"})}
|
{...accountForm.getInputProps("isAdmin", { type: "checkbox" })}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -58,7 +58,7 @@ const Account = () => {
|
||||||
return (
|
return (
|
||||||
<Container size="sm">
|
<Container size="sm">
|
||||||
<Title order={3} mb="xs">
|
<Title order={3} mb="xs">
|
||||||
My account
|
My account
|
||||||
</Title>
|
</Title>
|
||||||
<Paper withBorder p="xl">
|
<Paper withBorder p="xl">
|
||||||
<Title order={5} mb="xs">
|
<Title order={5} mb="xs">
|
||||||
|
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue