Skip to content

Commit

Permalink
feat: improve persons creation API
Browse files Browse the repository at this point in the history
  • Loading branch information
joscha committed Jul 30, 2024
1 parent 0db8447 commit b548c19
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/v1/persons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export type CreatePersonRequest = {
/**
* The email addresses of the person. If there are no email addresses, please specify an empty array.
*/
emails: string[]
emails?: string[]
/**
* An array of unique identifiers of organizations that the person is associated with.
*/
Expand Down Expand Up @@ -349,7 +349,10 @@ export class Persons {
): Promise<SimplePersonResponse> {
const response = await this.axios.post<SimplePersonResponse>(
personsUrl(),
data,
{
emails: [], // the API requires this field to be present
...data,
},
)
return response.data
}
Expand Down

0 comments on commit b548c19

Please sign in to comment.