Files
FE_CPONE/test/vuex/one-sampling-verification-adhi/api/verification_patient.js
2026-04-27 10:13:31 +07:00

92 lines
2.1 KiB
JavaScript

// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/sampling/verification_2/";
export async function search(nolab, search) {
try {
var resp = await axios.post(URL + 'verification_patient/search', {
search: search,
nolab: nolab
});
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 search_sent() {
// try {
// var resp = await axios.post(URL + 'receive_patient/search_sent', {});
// 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(orderid, laststatusid, datax) {
try {
var resp = await axios.post(URL + 'verification_patient/verify', {
orderid: orderid,
laststatusid: laststatusid,
data: datax
});
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 reject(orderid, laststatusid, datax) {
try {
var resp = await axios.post(URL + 'verification_patient/reject', {
orderid: orderid,
laststatusid: laststatusid,
data: datax
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}