import api from "src/api";

export const getKanbanMedias = async (kanbanId) => {
  const { data } = await api.get(`/franchisee/activities/${kanbanId}/medias`);
  return data.payload;
};

export const uploadKanbanMedia = async (kanbanId, file) => {
  const form = new FormData();
  form.append("file", file);
  const { data } = await api.post(`/franchisee/activities/${kanbanId}/medias`, form, {
    headers: { "Content-Type": "multipart/form-data" },
  });
  return data.payload;
};

export const deleteKanbanMedia = async (kanbanId, id) => {
  const { data } = await api.delete(`/franchisee/activities/${kanbanId}/medias/${id}`);
  return data;
};
