mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 22:04:23 +00:00
[apimethods] Fixed: prevent makeFetch to add a null body on GET and HEAD
requests
This commit is contained in:
parent
d1b9400257
commit
ffd1145cd0
@ -65,9 +65,12 @@ export const makeFetch = <Input, Output>(method: 'POST'|'GET'|'PUT'|'PATCH'|'DEL
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8'
|
||||
},
|
||||
body: (body !== null || typeof body !== 'undefined') ? JSON.stringify(body) : null
|
||||
};
|
||||
|
||||
if (body !== null || typeof body !== 'undefined') {
|
||||
Object.assign(opts, {body: JSON.stringify(body)})
|
||||
}
|
||||
|
||||
if (typeof options !== 'undefined') {
|
||||
opts = Object.assign(opts, options);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user