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

export async function getAllLanguages() {
  return privateApi.get(`/language/get/all`).then((res) => res.data);
}

export async function createLanguage(data: {title: string,slug:string}) {
  return await privateApi
    .post("/language/create", data)
    .then((res) => res.data);
}
export async function updateLanguage({data,id}:{data:{title:string},id:string}) {
  return await privateApi
    .put(`/language/update/${id}"`, data)
    .then((res) => res.data);
}
export async function deleteLanguage(id: string) {
  return await privateApi
    .delete(`/language/delete/${id}`)
    .then((res) => res.data);
}
