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

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


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

export const createPlayer = async (body: EnrolCourseInput): Promise<AxiosResponse<EnrolCourseInput, any>> => {
   return await axiosInstance.post<EnrolCourseInput>('/student/enrol', body);
};


export const updatePlayer = async (body: CertifyInput): Promise<AxiosResponse<CertifyInput, any>> => {
   return await axiosInstance.post<CertifyInput>('/student/certify', body);
};


