import api from "src/api";

export const getPartnersByUnit = async () => {
  const { data } = await api.get("/unit-partner/me");
  return data.payload;
};

export const createPartner = async (formData) => {
  const { data } = await api.post("/unit-partner/me", formData, {
    headers: { "Content-Type": "multipart/form-data" },
  });

  return data.payload;
};

export const updatePartner = async (id, formData) => {
  const { data } = await api.put(`/unit-partner/me/${id}`, formData, {
    headers: { "Content-Type": "multipart/form-data" },
  });

  return data.payload;
};

export const deletePartner = async (id) => {
  const { data } = await api.delete(`/unit-partner/me/${id}`);
  return data;
};
