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

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


export const geOneSeason = (seasonId: number) => {
   return axiosInstance.get(`season/view?s=${seasonId}`);
}

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


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


