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

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


export const geOneStanding = (standingId: number) => {
   return axiosInstance.get(`standing/view?s=${standingId}`);
}

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


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


