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:
Jason Rasmussen 2024-03-07 15:34:57 -05:00 committed by GitHub
parent f1a8e385e9
commit 661409bac7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 372 additions and 148 deletions

View file

@ -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;