diff --git a/front_end/src/requetes.tsx b/front_end/src/requetes.tsx index c3cbb59..764eb77 100644 --- a/front_end/src/requetes.tsx +++ b/front_end/src/requetes.tsx @@ -199,6 +199,16 @@ export async function getAllUserAPI(): Promise { } } +export async function getCoachByIdAPI(id:number): Promise { + 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 {