Files
FE_CPONE/test/vuex/one-fo-registration-walk-in/api/company.js
2026-04-27 10:13:31 +07:00

79 lines
1.7 KiB
JavaScript

const URL = "/one-api/mockup/fo/walk_in_registration/";
export async function search(search) {
try {
var resp = await axios.post(URL + 'company/search',{search:search,token:window.one_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 search_default() {
try {
var resp = await axios.post(URL + 'company/search_default');
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 search_project(prm) {
try {
var resp = await axios.post(URL + 'company/search_project',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 search_fisik_template(prm) {
try {
var resp = await axios.post(URL + 'company/search_fisik_template',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
};
}
}