Files
2026-05-25 20:01:37 +07:00

203 lines
4.8 KiB
JavaScript

const URL = "/one-api/v1/masterdata/";
export async function save(prm) {
try {
var resp = await axios.post(URL + 'subgroup/addnewsubgroup', 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 + 'subgroup/deletesubgroup', { 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 searchgroup(prm) {
try {
var resp = await axios.post(URL + 'subgroup/searchgroup',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 searchcity(prm) {
try {
var resp = await axios.post(URL + 'subgroup/searchcity',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 searchdistrict(prm) {
try {
var resp = await axios.post(URL + 'subgroup/searchdistrict',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 searchkelurahan(prm) {
try {
var resp = await axios.post(URL + 'subgroup/searchkelurahan',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 searchcompany(prm) {
try {
var resp = await axios.post(URL + 'subgroup/searchcompany',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 searchmou(prm) {
try {
var resp = await axios.post(URL + 'subgroup/searchmou',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 searchdoctor(prm) {
try {
var resp = await axios.post(URL + 'subgroup/searchdoctor',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 lookupbyname(prm) {
try {
var resp = await axios.post(URL + 'subgroup/lookupsubgroupbyname', 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 selectaddressdoctor(prm) {
try {
var resp = await axios.post(URL + 'subgroup/selectaddressdoctor',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
};
}
}