* fix: add firstname and lastanme to user model * fix: avoid undefined in displayName resolve field * fix: user firstName and lastName instead of firstname lastname * fix: person table proper naming firstName lastName * fix: migrate front with firstName and lastName * fix: make front-graphql-generate not working
44 lines
806 B
TypeScript
44 lines
806 B
TypeScript
import {
|
|
IsEmail,
|
|
IsNotEmpty,
|
|
IsOptional,
|
|
IsString,
|
|
Matches,
|
|
MinLength,
|
|
} from 'class-validator';
|
|
import { PASSWORD_REGEX } from '../auth.util';
|
|
import { ArgsType, Field } from '@nestjs/graphql';
|
|
|
|
@ArgsType()
|
|
export class RegisterInput {
|
|
@Field(() => String)
|
|
@IsNotEmpty()
|
|
@IsEmail()
|
|
email: string;
|
|
|
|
@Field(() => String)
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
@MinLength(8)
|
|
@Matches(PASSWORD_REGEX, { message: 'password too weak' })
|
|
password: string;
|
|
|
|
@Field(() => String, {
|
|
deprecationReason: 'Deprecated, please use firstName and lastName instead',
|
|
nullable: true,
|
|
})
|
|
@IsOptional()
|
|
@IsString()
|
|
displayName?: string;
|
|
|
|
@Field(() => String)
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
firstName: string;
|
|
|
|
@Field(() => String)
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
lastName: string;
|
|
}
|