import axios from "axios";
import { envConfig } from "./config";
import Cookies from "js-cookie";

export async function GetSancionByStudent(numAcount: number) {
  try {
    const token = Cookies.get("token");
    const headers = { Authorization: `Bearer ${token}` };

    const response = await axios.get(
      `${envConfig.apiUrl}/alumno-sancion/${numAcount}`, { headers }
    );

    return response.data;
  } catch (error: any) {
    const msg =
      error.response?.data?.message ||
      error.message ||
      "Error desconocido al obtener estudiante";
    return { error: msg };
  }
}
//IO
