import api from "./client";

export const DictVspApi = {
  get(params) {
    return api.get(`/dict/info`, { params }).then((r) => r.data);
  },
  getById(id) {
    return api.get(`/dict/info/${id}`).then((r) => r.data);
  },
  create(payload) {
    return api.post(`/dict/info`, payload).then((r) => r.data);
  },
  update(dict_vsp_id, payload) {
    return api.put(`/dict/info/${dict_vsp_id}`, payload).then((r) => r.data);
  },
  delete(dict_vsp_id) {
    return api.delete(`/dict/info/${dict_vsp_id}`).then((r) => r.data);
  },
  export(payload) {
    return api.post(`/dict/info/export`, payload, {
      responseType: "blob",
    });
  },
  getDropdownVsp(params) {
    return api.get(`/dict/info/dropdown`, { params }).then((r) => r.data);
  },
};
