const URL = "/one-api/mockup/masterdata/expedition/";
export async function lookup(prm) {
  try {
    var resp = await axios.post(URL + "search", prm);
    if (resp.status != 200) {
      return {
        status: "ERR",
      };
    }
    let data = resp.data;
    return data;
  } catch (e) {
    return {
      status: "ERR",
      message: e.message,
    };
  }
}

export async function get_staff(prm) {
  try {
    var resp = await axios.post(URL + "get_staff", prm);
    if (resp.status != 200) {
      return {
        status: "ERR",
      };
    }
    let data = resp.data;
    return data;
  } catch (e) {
    return {
      status: "ERR",
      message: e.message,
    };
  }
}
export async function additem(prm) {
  try {
    var resp = await axios.post(URL + "add", prm);
    if (resp.status != 200) {
      return {
        status: "ERR",
      };
    }
    let data = resp.data;
    return data;
  } catch (e) {
    return {
      status: "ERR",
      message: e.message,
    };
  }
}
export async function edititem(prm) {
  try {
    var resp = await axios.post(URL + "edit", prm);
    if (resp.status != 200) {
      return {
        status: "ERR",
      };
    }
    let data = resp.data;
    return data;
  } catch (e) {
    return {
      status: "ERR",
      message: e.message,
    };
  }
}
export async function deleteitem(prm) {
  try {
    var resp = await axios.post(URL + "delete", prm);
    if (resp.status != 200) {
      return {
        status: "ERR",
      };
    }
    let data = resp.data;
    return data;
  } catch (e) {
    return {
      status: "ERR",
      message: e.message,
    };
  }
}
