mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-04-28 01:33:57 +00:00
fix(server): user update (#2143)
* fix(server): user update * update dto * generate api * improve validation * add e2e tests for updating user --------- Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
This commit is contained in:
@@ -1,28 +1,18 @@
|
||||
import { IsEmail, IsNotEmpty, IsOptional } from 'class-validator';
|
||||
import { IsBoolean, IsNotEmpty, IsOptional, IsUUID } from 'class-validator';
|
||||
import { CreateUserDto } from './create-user.dto';
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger';
|
||||
|
||||
export class UpdateUserDto {
|
||||
export class UpdateUserDto extends PartialType(CreateUserDto) {
|
||||
@IsNotEmpty()
|
||||
@IsUUID('4')
|
||||
@ApiProperty({ format: 'uuid' })
|
||||
id!: string;
|
||||
|
||||
@IsEmail()
|
||||
@IsOptional()
|
||||
email?: string;
|
||||
|
||||
@IsOptional()
|
||||
password?: string;
|
||||
|
||||
@IsOptional()
|
||||
firstName?: string;
|
||||
|
||||
@IsOptional()
|
||||
lastName?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
isAdmin?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
shouldChangePassword?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
profileImagePath?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user