diff --git a/frontend/src/lib/repo.ts b/frontend/src/lib/repo.ts index 3100756..b382219 100644 --- a/frontend/src/lib/repo.ts +++ b/frontend/src/lib/repo.ts @@ -1,6 +1,6 @@ const API_URL = "https://ale-dev.teck-developer.com/api"; -const getAllRoutes = async () => { +const getAllRoutes = async (fetch) => { let data = []; const response = await fetch(`${API_URL}/all-routes`); @@ -10,7 +10,7 @@ const getAllRoutes = async () => { return data; } -const getRouteCategories = async () => { +const getRouteCategories = async (fetch) => { let data = []; const response = await fetch(`${API_URL}/route-categories`); @@ -20,7 +20,7 @@ const getRouteCategories = async () => { return data; } -const getRouteByCategory = async (categoryId: number) => { +const getRouteByCategory = async (fetch,categoryId: number) => { let data = []; const response = await fetch(`${API_URL}/route-by-category/${categoryId}`); const json = await response.json(); @@ -29,7 +29,7 @@ const getRouteByCategory = async (categoryId: number) => { return data; } -const getRoute = async (routeId: number) => { +const getRoute = async (fetch,routeId: number) => { let data = {}; const response = await fetch(`${API_URL}/route/${routeId}`); const json = await response.json(); @@ -39,7 +39,7 @@ const getRoute = async (routeId: number) => { } -const getSport = async (routeId: number, sportId: number) => { +const getSport = async (fetch,routeId: number, sportId: number) => { let data = {}; const response = await fetch(`${API_URL}/route/${routeId}/${sportId}`); const json = await response.json(); @@ -48,7 +48,7 @@ const getSport = async (routeId: number, sportId: number) => { return data; } -const getPlacemarks = async (routeId: number, sportId: number) => { +const getPlacemarks = async (fetch,routeId: number, sportId: number) => { let data = {}; const response = await fetch(`${API_URL}/getPlacemarks/${routeId}/${sportId}`); const json = await response.json();