Files
FE_CPONE/test/vuex/cpone-md-location/api/location.js
2026-04-27 10:13:31 +07:00

88 lines
1.7 KiB
JavaScript

const URL = "/one-api/mockup/masterdata/one-md-location/location/";
export async function lookup(prm) {
try {
var resp = await axios.post(URL + "search", prm);
if (resp.status != 200) {
return {
status: "ERR",
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message,
};
}
}
export async function station(prm) {
try {
var resp = await axios.post(URL + "get_station", prm);
if (resp.status != 200) {
return {
status: "ERR",
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message,
};
}
}
export async function additem(prm) {
try {
var resp = await axios.post(URL + "add", prm);
if (resp.status != 200) {
return {
status: "ERR",
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message,
};
}
}
export async function update(prm) {
try {
var resp = await axios.post(URL + "edit", prm);
if (resp.status != 200) {
return {
status: "ERR",
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message,
};
}
}
export async function xdelete(prm) {
try {
var resp = await axios.post(URL + "delete", prm);
if (resp.status != 200) {
return {
status: "ERR",
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message,
};
}
}