changes
This commit is contained in:
@@ -1197,18 +1197,18 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
const found = findapi(name);
|
||||
const curpath = found.path ? paths.find((x) => x.name === found.path).url : path;
|
||||
let rs;
|
||||
if (!Array.isArray(data)) {
|
||||
rs = await $fetch(`${curpath}${found.url}`, {
|
||||
method: "POST",
|
||||
body: data,
|
||||
params: { values },
|
||||
});
|
||||
} else {
|
||||
if (Array.isArray(data)) {
|
||||
rs = await $fetch(`${curpath}import-data/${found.url.substring(5, found.url.length - 1)}/`, {
|
||||
method: "POST",
|
||||
body: data,
|
||||
params: { values, action: "import" },
|
||||
});
|
||||
} else {
|
||||
rs = await $fetch(`${curpath}${found.url}`, {
|
||||
method: "POST",
|
||||
body: data,
|
||||
params: { values },
|
||||
});
|
||||
}
|
||||
// update store
|
||||
if (found.commit) {
|
||||
|
||||
Reference in New Issue
Block a user