const URL = "/one-api/mockup/fo/promise/"; export async function search(prm) { try { var resp = await axios.post(URL + 'promisenotok/search',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 }; } } export async function gettests(prm) { try { var resp = await axios.post(URL + 'promisenotok/gettests',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 }; } } export async function getdatapromises(prm) { try { var resp = await axios.post(URL + 'promisenotok/getdatapromises',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 }; } } export async function receivesample(prm) { try { var resp = await axios.post(URL + 'promisenotok/receivesample',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 }; } } export async function search_staff(prm) { try { var resp = await axios.post(URL + 'promisenotok/search_staff',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 }; } } export async function searchcompany(token,prm) { try { var resp = await axios.post(URL + 'promisenotok/searchcompany',{token:token,search: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 }; } } export async function search_patient(prm) { try { var resp = await axios.post(URL + 'promisenotok/search_patient',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 }; } } export async function getrequirements(prm) { try { var resp = await axios.post(URL + 'promisenotok/getrequirements',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 }; } } export async function getstationstatus(token) { try { var resp = await axios.post(URL + 'promisenotok/getstationstatus',{token:token}); 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 savenewpromise(prm) { try { var resp = await axios.post(URL + 'promisenotok/savenewpromise',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 }; } } export async function newsamplingcall(prm) { try { var resp = await axios.post(URL + 'promisenotok/newsamplingcall',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 }; } } export async function xdelete(prm) { try { var resp = await axios.post(URL + 'promisenotok/deletesamplingcall',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 }; } } export async function getaddress(prm) { try { var resp = await axios.post(URL + 'promisenotok/getaddress',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 }; } } export async function searchcity(token,prm) { try { var resp = await axios.post(URL + 'promisenotok/searchcity',{token:token,search: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 }; } } export async function getdistrict(token,prm) { try { var resp = await axios.post(URL + 'promisenotok/getdistrict',{id:prm.M_CityID,token:token}); 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 getkelurahan(token,prm) { try { var resp = await axios.post(URL + 'promisenotok/getkelurahan',{token:token,id:prm.M_DistrictID}); 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 savenewaddress(prm) { try { var resp = await axios.post(URL + 'promisenotok/savenewaddress',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 }; } } export async function saveeditaddress(prm) { try { var resp = await axios.post(URL + 'promisenotok/saveeditaddress',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 }; } } export async function deleteaddress(prm) { try { var resp = await axios.post(URL + 'promisenotok/deleteaddress',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 }; } } export async function getsampletypes(prm) { try { var resp = await axios.post(URL + 'promisenotok/getsampletypes',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 }; } } export async function doaction(prm) { try { var resp = await axios.post(URL + 'promisenotok/doaction',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 }; } } export async function addnewlabel(prm) { try { var resp = await axios.post(URL + 'promisenotok/addnewlabel',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 }; } } export async function getdatanoterequirement(prm) { try { var resp = await axios.post(URL + 'promisenotok/getdatanoterequirement',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 }; } } export async function savenotesampling(prm) { try { var resp = await axios.post(URL + 'promisenotok/savenotesampling',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 }; } }