diff --git a/packages/api-client/src/index.ts b/packages/api-client/src/index.ts index c75b39da3b387fa9ebbb50eb2d0e9ea0562569cc..02a40b8a54f93b5282fd780058e86cc9268c94af 100644 --- a/packages/api-client/src/index.ts +++ b/packages/api-client/src/index.ts @@ -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(); }); } @@ -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(); }); };