mirror of
https://github.com/Art051/immich.git
synced 2025-08-11 19:29:00 +00:00
* feat: user storage label * chore: open api * fix: checks * fix: api update validation and tests * feat: default admin storage label * fix: linting * fix: user create/update dto * fix: delete library with custom label
45 lines
871 B
TypeScript
45 lines
871 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { Transform } from 'class-transformer';
|
|
import { IsBoolean, IsEmail, IsNotEmpty, IsOptional, IsString, IsUUID } from 'class-validator';
|
|
import { toEmail, toSanitized } from '../../../../../apps/immich/src/utils/transform.util';
|
|
|
|
export class UpdateUserDto {
|
|
@IsOptional()
|
|
@IsEmail()
|
|
@Transform(toEmail)
|
|
email?: string;
|
|
|
|
@IsOptional()
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
password?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
firstName?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
lastName?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@Transform(toSanitized)
|
|
storageLabel?: string;
|
|
|
|
@IsNotEmpty()
|
|
@IsUUID('4')
|
|
@ApiProperty({ format: 'uuid' })
|
|
id!: string;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isAdmin?: boolean;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
shouldChangePassword?: boolean;
|
|
}
|