mirror of
https://github.com/Art051/immich.git
synced 2025-08-11 19:29:00 +00:00
* custom `IsOptional` * added link to source * formatting * Update server/src/domain/domain.util.ts Co-authored-by: Jason Rasmussen <jrasm91@gmail.com> * nullable birth date endpoint * made `nullable` a property * formatting * removed unused dto * updated decorator arg * fixed album e2e tests * add null tests for auth e2e * add null test for person e2e * fixed tests * added null test for user e2e * removed unusued import * log key in test name * chore: add note about mobile not being able to use the endpoint --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
53 lines
956 B
TypeScript
53 lines
956 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { Transform } from 'class-transformer';
|
|
import { IsBoolean, IsEmail, IsNotEmpty, IsString, IsUUID } from 'class-validator';
|
|
import { toEmail, toSanitized, Optional } from '../../domain.util';
|
|
|
|
export class UpdateUserDto {
|
|
@Optional()
|
|
@IsEmail({ require_tld: false })
|
|
@Transform(toEmail)
|
|
email?: string;
|
|
|
|
@Optional()
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
password?: string;
|
|
|
|
@Optional()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
firstName?: string;
|
|
|
|
@Optional()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
lastName?: string;
|
|
|
|
@Optional()
|
|
@IsString()
|
|
@Transform(toSanitized)
|
|
storageLabel?: string;
|
|
|
|
@Optional()
|
|
@IsString()
|
|
externalPath?: string;
|
|
|
|
@IsNotEmpty()
|
|
@IsUUID('4')
|
|
@ApiProperty({ format: 'uuid' })
|
|
id!: string;
|
|
|
|
@Optional()
|
|
@IsBoolean()
|
|
isAdmin?: boolean;
|
|
|
|
@Optional()
|
|
@IsBoolean()
|
|
shouldChangePassword?: boolean;
|
|
|
|
@Optional()
|
|
@IsBoolean()
|
|
memoriesEnabled?: boolean;
|
|
}
|