feat: add user operations to backend

This commit is contained in:
Elias Schneider
2022-12-05 10:02:19 +01:00
parent e9526fc039
commit 31b3f6cb2f
11 changed files with 176 additions and 81 deletions

View File

@@ -1,17 +1,6 @@
import { PickType } from "@nestjs/swagger";
import { Expose } from "class-transformer";
import { IsEmail, Length, Matches } from "class-validator";
import { PickType } from "@nestjs/mapped-types";
import { UserDTO } from "src/user/dto/user.dto";
export class AuthRegisterDTO extends PickType(UserDTO, ["password"] as const) {
@Expose()
@Matches("^[a-zA-Z0-9_.]*$", undefined, {
message: "Username can only contain letters, numbers, dots and underscores",
})
@Length(3, 32)
username: string;
@Expose()
@IsEmail()
email: string;
export class AuthRegisterDTO extends PickType(UserDTO, ["email", "username", "password"] as const) {
}