Files
FE_CPONE/test/vuex/one-fo-verification-simple/api/patient.js
2026-04-27 10:13:31 +07:00

67 lines
1.5 KiB
JavaScript

const URL = "/one-api/mockup/fo/verification/";
export async function search(token, nolab, nama, status) {
try {
var resp = await axios.post(URL + 'patient/search', {
token:token,
nolab: nolab,
nama: nama,
status: status
});
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 save(token, patient, status) {
try {
var resp = await axios.post(URL + 'patient/save', {
token:token,
patient: patient,
status: status
});
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 verify(prm) {
try {
var resp = await axios.post(URL + 'patient/verify', 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
};
}
}