import api from "src/api";

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

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

  return data.payload;
};

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

  return data.payload;
};

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