/* 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 getStudents = () => {
   return axiosInstance.get(`student/all`);
}


export const geOneStudent = (studentId: number) => {
   return axiosInstance.get(`student/view-student?s=${studentId}`);
}

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


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


