const URL = "/one-api/mockup/masterdata/"; export async function searchdetail(prm) { try { var resp = await axios.post(URL + 'summaryfisik/searchdetail', 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 searchtemplatecode(token, prm) { try { var resp = await axios.post(URL + 'summaryfisik/searchtemplatecode', { 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 addnewdetail(prm) { try { var resp = await axios.post(URL + 'summaryfisik/addnewdetail', 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 updatedetail(prm) { try { var resp = await axios.post(URL + 'summaryfisik/updatedetail', 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 deletedetail(token,id) { try { var resp = await axios.post(URL + 'summaryfisik/deletedetail', { 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 }; } }