import { CreateOnlineCaseFormValues } from "@/components/forms/online-case/new/CreateOnlineCaseForm";
import privateApi from "../http/privateCall.axios";

export async function getAllOnlineCases() {
  return await privateApi.get("/case/get/all").then((res) => res.data);
}
export async function getSingleOnlineCase(id: string) {
  return await privateApi.get(`/case/get/single/${id}`).then((res) => res.data);
}

export async function createOnlineCase(data: CreateOnlineCaseFormValues) {
  return await privateApi.post(`/case/create`, data).then((res) => res.data);
}
export async function updateOnlineCase({data, id}: {data: CreateOnlineCaseFormValues; id: string}) {
  return await privateApi
    .post(`/case/update/${id}`, data)
    .then((res) => res.data);
}
