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

88 lines
1.9 KiB
JavaScript

// API :
// search bank
// paramater : query , page , rowPerPage
const URL =
"/one-api/mockup/sampling/handling/";
export async function search(nolab, search) {
try {
var resp = await axios.post(URL + 'process_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 + 'process_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 send(ids) {
try {
var resp = await axios.post(URL + 'process_patient/send', {
ids: ids
});
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 remove(id) {
try {
var resp = await axios.post(URL + 'process_patient/remove', {
id: id
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}