1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-10 13:56:47 +01:00
immich/server/src/domain/auth/dto/sign-up.dto.ts

26 lines
608 B
TypeScript
Raw Normal View History

import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
2022-11-04 00:55:13 +01:00
import { IsEmail, IsNotEmpty, IsString } from 'class-validator';
2022-02-03 17:06:44 +01:00
export class SignUpDto {
@IsEmail({ require_tld: false })
@ApiProperty({ example: 'testuser@email.com' })
2022-11-04 00:55:13 +01:00
@Transform(({ value }) => value.toLowerCase())
email!: string;
2022-02-03 17:06:44 +01:00
2022-11-04 00:55:13 +01:00
@IsString()
2022-02-03 17:06:44 +01:00
@IsNotEmpty()
@ApiProperty({ example: 'password' })
password!: string;
2022-11-04 00:55:13 +01:00
@IsString()
@IsNotEmpty()
@ApiProperty({ example: 'Admin' })
firstName!: string;
2022-11-04 00:55:13 +01:00
@IsString()
@IsNotEmpty()
@ApiProperty({ example: 'Doe' })
lastName!: string;
2022-02-03 17:06:44 +01:00
}