import api from "src/api";

export const getContractsByUnit = async (unitId) => {
  const { data } = await api.get("/unit-contract", { params: { unit_id: unitId } });
  return data.payload;
};

export const createContract = async (formData) => {
  const { data } = await api.post("/unit-contract", formData, {
    headers: { "Content-Type": "multipart/form-data" },
  });
  return data.payload;
};

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