Files
REG_IBL/one-ui/masterdata/one-md-pola-kelainan-v2/api/kelainandetail.js
2026-05-25 20:01:37 +07:00

209 lines
4.4 KiB
JavaScript

const URL = "/one-api/mockup/masterdata/one-md-pola-kelainan-v2/";
export async function save(prm) {
try {
var resp = await axios.post(URL + "polakelainan/addnewkelainandetail", 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 + "polakelainan/deletekelainandetail", {
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 searchkelainangroup(prm) {
try {
var resp = await axios.post(URL + "polakelainan/searchkelainangroup", 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 + "polakelainan/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 + "polakelainan/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 + "polakelainan/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 + "polakelainan/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 + "polakelainan/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 + "polakelainan/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 + "polakelainan/lookupkelainandetailbyname",
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 + "polakelainan/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,
};
}
}