mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fixed: use correct comparison of body in makeFetch
This commit is contained in:
parent
4da9b6587d
commit
f12f640cb4
@ -67,13 +67,18 @@ export const makeFetch = <Input, Output>(method: 'POST'|'GET'|'PUT'|'PATCH'|'DEL
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (body !== null || typeof body !== 'undefined') {
|
console.log('for url '+url, body);
|
||||||
|
console.log('for url '+url, body !== null);
|
||||||
|
|
||||||
|
if (body !== null && typeof body !== 'undefined') {
|
||||||
Object.assign(opts, {body: JSON.stringify(body)})
|
Object.assign(opts, {body: JSON.stringify(body)})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof options !== 'undefined') {
|
if (typeof options !== 'undefined') {
|
||||||
opts = Object.assign(opts, options);
|
opts = Object.assign(opts, options);
|
||||||
}
|
}
|
||||||
|
console.log('will fetch', url);
|
||||||
|
console.log('content for ' + url, opts);
|
||||||
|
|
||||||
return fetch(url, opts)
|
return fetch(url, opts)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user