51 lines
1.1 KiB
JavaScript
51 lines
1.1 KiB
JavaScript
// API :
|
|
// search bank
|
|
// paramater : query , page , rowPerPage
|
|
const URL =
|
|
"/one-api/mockup/sampling/sampling/";
|
|
|
|
export async function search(nolab, search, station, status) {
|
|
try {
|
|
var resp = await axios.post(URL + 'patient_list/search', {
|
|
search: search,
|
|
nolab: nolab,
|
|
station: station,
|
|
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 get_stations(tokenx) {
|
|
try {
|
|
var resp = await axios.post(URL + 'patient_list/get_stations',
|
|
{token:tokenx}
|
|
);
|
|
if (resp.status != 200) {
|
|
return {
|
|
status: "ERR",
|
|
message: resp.statusText
|
|
};
|
|
}
|
|
let data = resp.data;
|
|
return data;
|
|
} catch(e) {
|
|
return {
|
|
status: "ERR",
|
|
message: e.message
|
|
};
|
|
}
|
|
}
|