merge
This commit is contained in:
@@ -63,7 +63,7 @@ export async function subscribeSessionAPI(user:User, session:Session):Promise<bo
|
||||
|
||||
export async function unsubscribeSessionAPI(user:User, session:Session):Promise<boolean>{
|
||||
try {
|
||||
await api.post(`/sessions/${session.id}/unsubscribe`, { userId: user.id });
|
||||
await api.post(`/session/${session.id}/unsubscribe`, { userId: user.id });
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error("Error unsubscribing from session:", error);
|
||||
@@ -84,9 +84,9 @@ export async function updateAllUserAPI(){
|
||||
// POST /////////////////////////////////////////////////////////
|
||||
|
||||
// COACH ADMIN
|
||||
export async function createSessionAPI(newSession: Session): Promise<Session> {
|
||||
export async function createSessionAPI(sessionDTO: any): Promise<Session> {
|
||||
try {
|
||||
const response = await api.post<Session>("/sessions", newSession);
|
||||
const response = await api.post<Session>("/session/create", sessionDTO);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error("Error creating session:", error);
|
||||
@@ -96,7 +96,7 @@ export async function createSessionAPI(newSession: Session): Promise<Session> {
|
||||
|
||||
export async function postActivityAPI(session: Session, activity: Activite){
|
||||
try {
|
||||
const response = await api.post<Activite>(`/sessions/${session.id}/activities`, activity);
|
||||
const response = await api.post<Activite>(`/session/${session.id}/activities`, activity);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error("Error creating activity:", error);
|
||||
@@ -122,7 +122,7 @@ export async function setSessionCreneauAPI(session: Session, date:Date){
|
||||
|
||||
export async function getSessionsAPI(): Promise<Session[]> {
|
||||
try {
|
||||
const response = await api.get<Session[]>("/sessions");
|
||||
const response = await api.get<Session[]>("/session");
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.error("Error fetching sessions:", error);
|
||||
|
||||
Reference in New Issue
Block a user