import { CreateExpertiseValues } from "@/components/forms/expertise/new/CreateExpertiseForm";
import privateApi from "../http/privateCall.axios";

export async function getAllExpertise(lang: string) {
  return privateApi.get(`/expertise/${lang}/get/all`).then((res) => res.data);
}
export async function getSingleExpertise(id: string) {
  return privateApi.get(`/expertise/get/single/${id}`).then((res) => res.data);
}

export async function createExpertise(data: CreateExpertiseValues) {
  return await privateApi
    .post(`/expertise/create`, data)
    .then((res) => res.data);
}
export async function updateExpertise({
  data,
  id,
}: {
  data: CreateExpertiseValues;
  id: string;
}) {
  return await privateApi
    .put(`/expertise/update/${id}`, data)
    .then((res) => res.data);
}

export async function deleteExpertise(id: string) {
  return await privateApi
    .delete(`/expertise/delete/${id}`)
    .then((res) => res.data);
}

export async function getExpertiseList() {
  return await privateApi
    .get(`/expertise/fa/get/all/list`)
    .then((res) => res.data);
}
