mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 12:27:07 +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 {
|
||||
if (!res.bodyUsed) { // It may have been consumed by a callback
|
||||
const validFormats = [ "arrayBuffer", "blob", "formData", "json", "text" ];
|
||||
if (init.format && validFormats.includes(init.format)) {
|
||||
return await res[init.format]();
|
||||
if (opts.format && validFormats.includes(opts.format)) {
|
||||
return await res[opts.format]();
|
||||
} else {
|
||||
return await res.json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user