Skip to content

Commit

Permalink
[FIX] Undefined headers on API Client (#26083)
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-rajpal committed Jul 1, 2022
1 parent aa95ee0 commit 1bb284d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/api-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class RestClient implements RestClientInterface {
console.warn('Endpoint cannot contain query string', endpoint);
}
const queryParams = this.getParams(params);
return this.send(`${endpoint}${queryParams ? `?${queryParams}` : ''}`, 'GET', options).then(function (response) {
return this.send(`${endpoint}${queryParams ? `?${queryParams}` : ''}`, 'GET', options ?? {}).then(function (response) {
return response.json();
});
}
Expand Down Expand Up @@ -141,7 +141,7 @@ export class RestClient implements RestClientInterface {
};

delete: RestClientInterface['delete'] = (endpoint, params, options) => {
return this.send(endpoint, 'DELETE', options).then(function (response) {
return this.send(endpoint, 'DELETE', options ?? {}).then(function (response) {
return response.json();
});
};
Expand Down

0 comments on commit 1bb284d

Please sign in to comment.