Skip to content

Commit

Permalink
Merge pull request #78 from regulaforensics/fix/sp-12517
Browse files Browse the repository at this point in the history
SP-12517 -methods without arguments guard
  • Loading branch information
SergeyIlchenko authored Nov 23, 2023
2 parents a6b8bca + 670d7f4 commit ba267df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/ext/group-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export class GroupApi {
}

async createGroup(groupToCreate: GroupToCreate, xRequestID?: string, options?: AxiosRequestConfig): Promise<Group> {
const response = await this.superClass.createGroup(groupToCreate, xRequestID, options);
const groupToCreateWithGuard = {
...groupToCreate,
metadata: !groupToCreate?.metadata ? {} : groupToCreate.metadata
}
const response = await this.superClass.createGroup(groupToCreateWithGuard, xRequestID, options);
return response.data;
}

Expand Down
6 changes: 5 additions & 1 deletion src/ext/person-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ export class PersonApi {
}

async createPerson(personFields: PersonFields, xRequestID?: string, options?: AxiosRequestConfig): Promise<Person> {
const response = await this.superClass.createPerson(personFields, xRequestID, options);
const personFieldsWithGuard = {
...personFields,
metadata: !personFields?.metadata ? {} : personFields.metadata
}
const response = await this.superClass.createPerson(personFieldsWithGuard, xRequestID, options);
return response.data;
}
async addImageToPerson(
Expand Down

0 comments on commit ba267df

Please sign in to comment.