/* eslint-disable @typescript-eslint/no-explicit-any */
"use serve"
import axiosInstance from "@/lib/constant";
import { FixtureInput, UpdateFixtureInput } from "./type";
import { AxiosResponse } from "axios";

export const getFixtures = () => {
   return axiosInstance.get(`fixture/all`);
}


export const geOneFixture = (fixtureId: number) => {
   return axiosInstance.get(`fixture/view?f=${fixtureId}`);
}

export const createFixture = async (body: FixtureInput): Promise<AxiosResponse<FixtureInput, any>> => {
   return await axiosInstance.post<FixtureInput>('/fixture/add', body);
};


export const updateFixture = async (body: UpdateFixtureInput): Promise<AxiosResponse<UpdateFixtureInput, any>> => {
   return await axiosInstance.post<UpdateFixtureInput>('/fixture/update', body);
};


