import privateApi from "../http/privateCall.axios";

export async function getAllTos() {
  return await privateApi.get("/tos/get/all").then((res) => res.data);
}

export async function getTosByVersion(version: string) {
  return await privateApi
    .get(`/tos/get/version/${version}`)
    .then((res) => res.data);
}

export async function createTos(data: {
  title: string;
  version: string;
  content: string;
  isActive: boolean;
}) {
  return await privateApi.post("/tos/create", data).then((res) => res.data);
}
export async function toggleTosActive(version: string) {
  return await privateApi.patch(`/tos/toggle`, {version}).then((res) => res.data);
}
export async function deleteTos(version: string) {
  return await privateApi.delete(`/tos/delete/${version}`).then((res) => res.data);
}
