diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts index 7ef909884..d12871bdd 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts @@ -65,9 +65,12 @@ export const makeFetch = (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); }