Flatten nested repos
This commit is contained in:
97
test/vuex/one-md-nat-unit/api/unitlang.js
Normal file
97
test/vuex/one-md-nat-unit/api/unitlang.js
Normal file
@@ -0,0 +1,97 @@
|
||||
const URL = "/one-api/mockup/masterdata/";
|
||||
|
||||
export async function save(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'unit/addnewunitlang', prm);
|
||||
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 + 'unit/deleteunitlang', { 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 lookup(token,id) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'unit/lookupunitlang', { 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 lookupunitlang(token,id,search,current_page) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'unit/lookupunitlangx', { id: id, token:token, search: search, current_page:current_page });
|
||||
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 lookupunitlanghide(token,id,search,current_page) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'unit/lookupunitlanghidex', { id: id, token:token, search: search, current_page:current_page });
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user