mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:07:08 +00:00
Move API action option to the correct argument
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user