mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-01-10 19:26:02 +00:00
27 lines
575 B
TypeScript
27 lines
575 B
TypeScript
import { AssetFaceEntity, PersonEntity } from '@app/infra/entities';
|
|
import { IsNotEmpty, IsString } from 'class-validator';
|
|
|
|
export class PersonUpdateDto {
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
name!: string;
|
|
}
|
|
|
|
export class PersonResponseDto {
|
|
id!: string;
|
|
name!: string;
|
|
thumbnailPath!: string;
|
|
}
|
|
|
|
export function mapPerson(person: PersonEntity): PersonResponseDto {
|
|
return {
|
|
id: person.id,
|
|
name: person.name,
|
|
thumbnailPath: person.thumbnailPath,
|
|
};
|
|
}
|
|
|
|
export function mapFace(face: AssetFaceEntity): PersonResponseDto {
|
|
return mapPerson(face.person);
|
|
}
|