Files
FE_CPONE/test/vuex/one-md-auto-verification/api/autoverificationlist.js
2026-04-27 10:13:31 +07:00

85 lines
2.1 KiB
JavaScript

const URL = "/one-api/mockup/masterdata/";
export async function lookup(token, search,all ) {
try {
var resp = await axios.post(URL + 'autoverification/lookup', { token: token, search: search, all:all });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function save(token,name) {
try {
var resp = await axios.post(URL + 'autoverification/addnewautoverification', {
token:token,
name: name
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function update(token,prm) {
try {
var resp = await axios.post(URL + 'autoverification/editautoverification', {
id:prm.id,
name: prm.name,
token:token
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(token,id) {
try {
var resp = await axios.post(URL + 'autoverification/deleteautoverification', { id: id, token:token });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}