const URL = "/one-api/mockup/masterdata/"; export async function search(token, packet_id, query) { try { var resp = await axios.post(URL + 'packet/search_px', { token:token, packet_id: packet_id, search: query }); 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(token, packet_id, packet_price, packet_original_price, json_px) { try { var resp = await axios.post(URL + 'packet/save_px', { token:token, packet_id: packet_id, packet_price: packet_price, packet_original_price: packet_original_price, json_px: json_px }); if (resp.status != 200) { return { status: "ERR", message: resp.statusText }; } let data = resp.data; return data; } catch (e) { return { status: "ERR", message: e.message }; } }