Files
twenty/server/src/core/auth/dto/register.input.ts
Jérémy M 097b278b11 fix: add firstName and lastName to user model (#473)
* 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
2023-06-29 15:11:15 +00:00

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;
}