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

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


export const geOneClub = (clubId: number) => {
   return axiosInstance.get(`club/view?c=${clubId}`);
}

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


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


