Flatten nested repos
This commit is contained in:
87
test/vuex/one-md-location/api/location.js
Normal file
87
test/vuex/one-md-location/api/location.js
Normal file
@@ -0,0 +1,87 @@
|
||||
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,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user