correction bug admin + lecture de toute les session dans l'edt pour l'admin
This commit is contained in:
@@ -62,11 +62,16 @@ export const activiteService = {
|
||||
getByTheme: (theme: string) => api.get(`/activite/theme/${encodeURIComponent(theme)}`),
|
||||
getDataActivite: (id: number | string) => api.get(`/activite/${id}`),
|
||||
};
|
||||
type DateBetween = {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
}
|
||||
|
||||
export const sessionService = {
|
||||
// controller uses singular /session/* endpoints
|
||||
create: (data: any) => api.post(`/session/create`, data),
|
||||
create: (data: SessionDTO) => api.post(`/session/create`, data),
|
||||
getAll: () => api.get<SessionDTO[]>(`/session/all`),
|
||||
getAllBetweenDate: (data: any) => api.get<SessionDTO[]>(`/session/all-between-dates`,{params: data,}),
|
||||
getById: (id: number | null) => api.get(`/session/${id}`),
|
||||
delete: (id: number | null) => api.delete(`/session/delete/${id}`),
|
||||
update: (id: number | null, data: any) => api.put(`/session/update/${id}`, data),
|
||||
@@ -79,7 +84,7 @@ export const sessionService = {
|
||||
|
||||
export const coachService = {
|
||||
// controller doesn't declare a class-level path consistently; support both common patterns
|
||||
create: (data: any) => api.post<CoachDTO>(`/coach/create`, data),
|
||||
create: (data: CoachDTO) => api.post<CoachDTO>(`/coach/create`, data),
|
||||
getAll: () => api.get<CoachDTO[]>(`/coach/all`),
|
||||
getById: (id: number) => api.get(`/coach/${id}`),
|
||||
getByKeycloakId: (keycloakId: string) => api.get(`/coach/keycloak/${keycloakId}`),
|
||||
@@ -97,7 +102,8 @@ export const userService = {
|
||||
|
||||
export const adminService = {
|
||||
getByKeycloakId: (keycloak_id: string) => api.get(`/admin/keycloak/${keycloak_id}`),
|
||||
getById: (id: number | string) => api.get(`/admin/${id}`),
|
||||
getById: (id: number | string) => api.get<AdminDTO>(`/admin/${id}`),
|
||||
create: (data: AdminDTO) => api.post<AdminDTO>("/admin/create", data),
|
||||
};
|
||||
|
||||
export default api;
|
||||
Reference in New Issue
Block a user