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

124 lines
3.2 KiB
JavaScript

const URL = "/one-api/mockup/masterdata/";
export async function search(token,search, id) {
try {
var resp = await axios.post(URL + 'autoverification/searchtest', { token:token,search: search, id: id });
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, testid, differenceid, validinterval, timeid, upperlimit, lowerlimit) {
try {
var resp = await axios.post(URL + 'autoverification/savedeltacheck', {
testid: testid,
differenceid: differenceid,
validinterval: validinterval,
timeid: timeid,
upperlimit: upperlimit,
lowerlimit: lowerlimit,
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 lookup(token,id) {
try {
var resp = await axios.post(URL + 'autoverification/lookupdeltacheck', { 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
};
}
}
export async function xdelete(token, id) {
try {
var resp = await axios.post(URL + 'autoverification/deleteautoverificationtest', { 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
};
}
}
export async function selecttime(token) {
try {
var resp = await axios.post(URL + 'autoverification/selecttime',{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 selectdif(token) {
try {
var resp = await axios.post(URL + 'autoverification/selectdif',{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
};
}
}