mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
feat(server): create a person with optional values (#7706)
* feat: create person dto * chore: open api * fix: e2e * fix: web usage
This commit is contained in:
parent
f1a8e385e9
commit
661409bac7
20 changed files with 372 additions and 148 deletions
|
|
@ -529,6 +529,15 @@ export type PeopleResponseDto = {
|
|||
people: PersonResponseDto[];
|
||||
total: number;
|
||||
};
|
||||
export type PersonCreateDto = {
|
||||
/** Person date of birth.
|
||||
Note: the mobile app cannot currently set the birth date to null. */
|
||||
birthDate?: string | null;
|
||||
/** Person visibility */
|
||||
isHidden?: boolean;
|
||||
/** Person name. */
|
||||
name?: string;
|
||||
};
|
||||
export type PeopleUpdateItem = {
|
||||
/** Person date of birth.
|
||||
Note: the mobile app cannot currently set the birth date to null. */
|
||||
|
|
@ -2051,14 +2060,17 @@ export function getAllPeople({ withHidden }: {
|
|||
...opts
|
||||
}));
|
||||
}
|
||||
export function createPerson(opts?: Oazapfts.RequestOpts) {
|
||||
export function createPerson({ personCreateDto }: {
|
||||
personCreateDto: PersonCreateDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 201;
|
||||
data: PersonResponseDto;
|
||||
}>("/person", {
|
||||
}>("/person", oazapfts.json({
|
||||
...opts,
|
||||
method: "POST"
|
||||
}));
|
||||
method: "POST",
|
||||
body: personCreateDto
|
||||
})));
|
||||
}
|
||||
export function updatePeople({ peopleUpdateDto }: {
|
||||
peopleUpdateDto: PeopleUpdateDto;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue