diff --git a/apps/api/src/contacts/people.controller.ts b/apps/api/src/contacts/people.controller.ts index b8a43f8..0f0401b 100644 --- a/apps/api/src/contacts/people.controller.ts +++ b/apps/api/src/contacts/people.controller.ts @@ -82,7 +82,11 @@ export class PeopleController { @Post() create(@CurrentUser() user: Actor, @Body() dto: CreatePersonDto) { - return this.peopleService.create(user, dto); + return this.peopleService.create(user, { + ...dto, + firstName: dto.firstName ?? '', + lastName: dto.lastName ?? '', + }); } @Patch(':id') diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 0893249..99fce49 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -423,8 +423,8 @@ export interface PersonDto { } export interface CreatePersonRequest { - firstName: string; - lastName: string; + firstName?: string; + lastName?: string; email?: string; phone?: string; mobile?: string;