Files
front-AT/app/lib/getStudent.ts
T
2025-09-22 14:53:19 -06:00

19 lines
438 B
TypeScript

import axios from "axios";
import { envConfig } from "./config";
export async function GetStudent(numAcount: number) {
try {
const response = await axios.get(
`${envConfig.apiUrl}/student/${numAcount}`
);
return response.data;
} catch (error: any) {
const msg =
error.response?.data?.message ||
error.message ||
"Error desconocido al obtener estudiante";
return { error: msg };
}
}
//IO