Merge branch 'main' of https://gitlab2.istic.univ-rennes1.fr/tuvu/hackathon
This commit is contained in:
@@ -78,7 +78,6 @@ export async function updateActivitiesOfSessionAPI(session:Session,activities:Ac
|
||||
} catch (error) {
|
||||
console.error("Error fetching activities for session:", error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export async function subscribeSessionAPI(user:User, session:Session):Promise<boolean>{
|
||||
@@ -105,11 +104,7 @@ export async function unsubscribeSessionAPI(user:User, session:Session):Promise<
|
||||
}
|
||||
}
|
||||
|
||||
// ADMIN :
|
||||
|
||||
export async function updateAllUserAPI(){
|
||||
|
||||
}
|
||||
|
||||
// POST /////////////////////////////////////////////////////////
|
||||
|
||||
@@ -125,7 +120,8 @@ export async function createSessionAPI(session: Session): Promise<Session> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function postActivityAPI(session: Session, activity: Activite){
|
||||
|
||||
export async function createActivityAPI(session: Session, activity: Activite){
|
||||
try {
|
||||
const response = await api.post<Activite>(`/session/${session.id}/activities`, activity);
|
||||
return response.data;
|
||||
@@ -178,7 +174,8 @@ export async function postSession(session: Session){
|
||||
}
|
||||
}
|
||||
|
||||
export async function postAdmin(athlete: Admin):Promise<Admin>{
|
||||
// SET /////////////////////////////////////////////////////////
|
||||
export async function createAdminAPI(athlete: Admin):Promise<Admin>{
|
||||
try {
|
||||
const response = await api.post<Admin>("/admin/create/",athlete);
|
||||
console.log(response);
|
||||
@@ -189,22 +186,20 @@ export async function postAdmin(athlete: Admin):Promise<Admin>{
|
||||
}
|
||||
}
|
||||
|
||||
// SET /////////////////////////////////////////////////////////
|
||||
|
||||
//ADMIN
|
||||
export async function setUserNameAPI(user: User, name: string){
|
||||
|
||||
}
|
||||
|
||||
//COACH
|
||||
export async function setSessionCreneauAPI(session: Session, date:Date){
|
||||
|
||||
}
|
||||
|
||||
//GET /////////////////////////////////////////////////////////
|
||||
|
||||
//SESSION
|
||||
//USER
|
||||
export async function getAllUserAPI(): Promise<User[]> {
|
||||
try{
|
||||
const response = await api.get<User[]>("/users/all");
|
||||
return response.data;
|
||||
}catch (error) {
|
||||
console.error("Error fetching users:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
//SESSION
|
||||
export async function getSessionsOfUserAPI(user:Coach|Athlete){
|
||||
try {
|
||||
if (user instanceof Coach) {
|
||||
|
||||
Reference in New Issue
Block a user