Move API action option to the correct argument

This commit is contained in:
D. Berge
2025-08-07 16:19:13 +02:00
parent a1c174994c
commit e5679ec14b

View File

@@ -108,8 +108,8 @@ async function api ({state, getters, commit, dispatch}, [resource, init = {}, cb
try { try {
if (!res.bodyUsed) { // It may have been consumed by a callback if (!res.bodyUsed) { // It may have been consumed by a callback
const validFormats = [ "arrayBuffer", "blob", "formData", "json", "text" ]; const validFormats = [ "arrayBuffer", "blob", "formData", "json", "text" ];
if (init.format && validFormats.includes(init.format)) { if (opts.format && validFormats.includes(opts.format)) {
return await res[init.format](); return await res[opts.format]();
} else { } else {
return await res.json(); return await res.json();
} }