Re-done session coach on creation

This commit is contained in:
Alexis Leboeuf
2026-01-09 12:54:37 +01:00
parent 34f37b99cc
commit 29bb452d19
3 changed files with 6 additions and 4 deletions

View File

@@ -128,10 +128,9 @@ export async function postActivityAPI(session: Session, activity: Activite){
export async function postAthlete(athlete: Athlete):Promise<Athlete>{
try {
//const response = await api.post<Athlete>("/athlete/create/",athlete.toDTO);
const response = await athleteService.create(athlete.toDTO());
const response = await api.post<Athlete>("/athlete/create/",athlete.toDTO);
console.log(response);
return new Athlete(response.data);
return response.data;
} catch (error) {
console.error("Error fetching coachs:", error);
throw error;