This commit is contained in:
trochas
2026-01-09 15:25:46 +01:00

View File

@@ -199,6 +199,16 @@ export async function getAllUserAPI(): Promise<User[]> {
}
}
export async function getCoachByIdAPI(id:number): Promise<Coach|null> {
try{
const response = await coachService.getById(id);
return new Coach(response.data);
}catch (error) {
console.error("Error fetching coach by id:", error);
return null;
}
}
//SESSION
export async function getSessionsOfUserAPI(user:Coach|Athlete){
try {