const URL = "/one-api/mockup/masterdata/one-mou-ready-release/"; export async function lookup(token, search,all ) { try { var resp = await axios.post(URL + 'companynewx2/lookup', { token: token, search: search, all:all }); 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 save(prm) { try { var resp = await axios.post(URL + 'companynewx2/addnewcompany', 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 update(prm) { try { var resp = await axios.post(URL + 'companynewx2/editcompany', 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(token,id) { try { var resp = await axios.post(URL + 'companynewx2/deletecompany', { id: id, 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 savecompanytype(prm) { try { var resp = await axios.post(URL + 'companynewx2/addnewcompanytype', 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 updatecompanytype(prm) { try { var resp = await axios.post(URL + 'companynewx2/editcompanytype', 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 deletecompanytype(prm) { try { var resp = await axios.post(URL + 'companynewx2/deletecompanytype', 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 selectcompanytype(token) { try { var resp = await axios.post(URL + 'companynewx2/selectcompanytype',{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 savecompanybusiness(prm) { try { var resp = await axios.post(URL + 'companynewx2/addnewcompanybusiness', 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 updatecompanybusiness(prm) { try { var resp = await axios.post(URL + 'companynewx2/editcompanybusiness', 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 deletecompanybusiness(prm) { try { var resp = await axios.post(URL + 'companynewx2/deletecompanybusiness', 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 selectcompanybusiness(token) { try { var resp = await axios.post(URL + 'companynewx2/selectcompanybusiness',{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 selecthierarchy(token) { try { var resp = await axios.post(URL + 'companynewx2/selecthierarchy',{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 selectcompanylevel(token,prm) { try { var resp = await axios.post(URL + 'companynewx2/selectcompanylevel',{token:token,id:prm.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 }; } } export async function searchcity(token,prm) { try { var resp = await axios.post(URL + 'companynewx2/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 searchdoctor(token,prm) { try { var resp = await axios.post(URL + 'companynewx2/searchdoctor',{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 searchcompanylevel(token,prm) { try { var resp = await axios.post(URL + 'companynewx2/searchcompanylevel',{token:token,name:prm.name,id:prm.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 }; } } export async function getstaff(token) { try { var resp = await axios.post(URL + 'companynewx2/getstaff',{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 getprovince(token) { try { var resp = await axios.post(URL + 'companynewx2/getprovince',{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 getcity(token,prm) { try { var resp = await axios.post(URL + 'companynewx2/getcity',{id:prm.M_ProvinceID,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 getdistrict(token,prm) { try { var resp = await axios.post(URL + 'companynewx2/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 + 'companynewx2/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 }; } }