Files
FE_CPONE/test/vuex/lama/t01/api.js
2026-04-27 10:13:31 +07:00

32 lines
657 B
JavaScript

// API :
// search patient
// paramater : query , page , rowPerPage
const URL =
"http://lebaran.aplikasi.web.id/smartlab_api/vuex/t01/search_patient";
export async function searchPatient(query, page, rowPerPage = 15) {
try {
var resp = await axios.post(URL, {
query: query,
page: page,
rowPerPage: rowPerPage
});
if (resp.status != 200) {
return {
status: "ERR",
query: query,
message: resp.statusText
};
}
let data = resp.data;
data.query = query;
return data;
} catch (e) {
return {
status: "ERR",
query: query,
message: e.message
};
}
}