getUser
This commit is contained in:
@@ -2,6 +2,7 @@ import axios from "axios";
|
||||
|
||||
import keycloak from "./keycloak";
|
||||
import { get } from "http";
|
||||
import { AdminDTO, AthleteDTO, CoachDTO } from "./classesDTO";
|
||||
|
||||
|
||||
const api = axios.create({
|
||||
@@ -37,7 +38,7 @@ export function clearAuthToken() {
|
||||
|
||||
export const athleteService = {
|
||||
// controller is mounted at /athlete
|
||||
create: (data: any) => api.post("/athlete/create", data),
|
||||
create: (data: any) => api.post<AthleteDTO>("/athlete/create", data),
|
||||
getAll: () => api.get("/athlete/all"),
|
||||
getById: (id: number | string) => api.get(`/athlete/${id}`),
|
||||
getByKeycloakId: (keycloakId: string) => api.get(`/athlete/keycloak/${encodeURIComponent(keycloakId)}`),
|
||||
@@ -81,7 +82,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(`/coach/create`, data),
|
||||
create: (data: any) => api.post<CoachDTO>(`/coach/create`, data),
|
||||
getAll: () => api.get(`/coach/all`),
|
||||
getByKeycloakId: (id: number | string) => api.get(`/coach/${id}`),
|
||||
update: (id: number | string, data: any) => api.put(`/coach/update/${id}`, data),
|
||||
|
||||
Reference in New Issue
Block a user