We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35e3a04 commit addb26dCopy full SHA for addb26d
1 file changed
app/assets/javascripts/qpixel_api.js
@@ -334,12 +334,17 @@ window.QPixel = {
334
},
335
336
fetchJSON: async (uri, data, options = {}) => {
337
+ const { headers = {}, ...restOptions } = options
338
+
339
/** @type {RequestInit} */
340
const requestInit = {
341
method: 'POST',
342
body: options.method === 'GET' ? void 0 : JSON.stringify(data),
- headers: { 'Content-Type': 'application/json' },
- ...options,
343
+ headers: {
344
+ 'Content-Type': 'application/json',
345
+ ...headers,
346
+ },
347
+ ...restOptions,
348
};
349
350
return QPixel.fetch(uri, requestInit);
0 commit comments