Merge branch 'main' of https://gitlab2.istic.univ-rennes1.fr/tuvu/hackathon
This commit is contained in:
@@ -4,6 +4,7 @@ import { Activite, Athlete, Coach , Session, Ligne, Admin } from "../classes";
|
||||
import {calculTempsDeJeuParLigne} from "../utils/ligneUtils";
|
||||
import { keyboard } from "@testing-library/user-event/dist/keyboard";
|
||||
import ObjectSession from "./object/session";
|
||||
import ObjectActivite from "./object/activite";
|
||||
import ObjectUser from "./object/user";
|
||||
import { getAllSessionsAPI } from "../requetes";
|
||||
import { useKeycloak } from "@react-keycloak/web";
|
||||
@@ -84,8 +85,8 @@ import { useKeycloak } from "@react-keycloak/web";
|
||||
))
|
||||
)}
|
||||
{value==="activites" && (
|
||||
allSessions.map((session) => ( //TODO
|
||||
<ObjectSession session={session}/>
|
||||
allActivites.map((activite) => (
|
||||
<ObjectActivite activite={activite}/>
|
||||
))
|
||||
)}
|
||||
{value==="coachs" && (
|
||||
|
||||
@@ -135,10 +135,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;
|
||||
|
||||
Reference in New Issue
Block a user