Fixed xhr
All checks were successful
Build / Build NPM Project (push) Successful in 15s
Build / Tag Version (push) Successful in 5s
Build / Publish (push) Successful in 13s

This commit is contained in:
2024-02-07 23:14:37 -05:00
parent b9cf282d32
commit ffaf8558b2
2 changed files with 3 additions and 2 deletions

View File

@ -45,7 +45,7 @@ export class XHR<T> {
return fetch(`${this.baseUrl}${href || ''}`.replace(/([^:]\/)\/+/g, '$1'), {
headers,
method: opts.method || (body ? 'POST' : 'GET'),
body: (headers['Content-Type'].startsWith('application/json') && body) ? JSON.stringify(body) : body
body: (headers['Content-Type']?.startsWith('application/json') && body) ? JSON.stringify(body) : body
}).then(async resp => {
for(let fn of this.getInterceptors()) {
const wait = new Promise(res =>