Compare commits
2 commits
4cd5994798
...
85b178ca07
Author | SHA1 | Date | |
---|---|---|---|
85b178ca07 | |||
a69112d901 |
3 changed files with 3883 additions and 47 deletions
|
@ -1,53 +1,39 @@
|
||||||
const API_URL = "http://localhost:8000/api";
|
const API_URL = "https://ale-dev.teck-developer.com/api";
|
||||||
|
|
||||||
const getAllRoutes = async () => {
|
const getAllRoutes = async () => {
|
||||||
let data = [];
|
let data = [];
|
||||||
if (import.meta.env.DEV && import.meta.env.PROD) {
|
|
||||||
const response = await fetch(`${API_URL}/all-routes`);
|
const response = await fetch(`${API_URL}/all-routes`);
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
data = json;
|
data = json;
|
||||||
} else {
|
|
||||||
data = (await import('./mock/routes.json')).default;
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRouteCategories = async () => {
|
const getRouteCategories = async () => {
|
||||||
let data = [];
|
let data = [];
|
||||||
if (import.meta.env.DEV && import.meta.env.PROD) {
|
|
||||||
const response = await fetch(`${API_URL}/route-categories`);
|
const response = await fetch(`${API_URL}/route-categories`);
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
data = json;
|
data = json;
|
||||||
} else {
|
|
||||||
data = (await import('./mock/routeCategories.json')).default;
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRouteByCategory = async (categoryId: number) => {
|
const getRouteByCategory = async (categoryId: number) => {
|
||||||
let data = [];
|
let data = [];
|
||||||
if (import.meta.env.DEV && import.meta.env.PROD) {
|
|
||||||
const response = await fetch(`${API_URL}/route-by-category/${categoryId}`);
|
const response = await fetch(`${API_URL}/route-by-category/${categoryId}`);
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
data = json;
|
data = json;
|
||||||
} else {
|
|
||||||
data = (await import('./mock/routeByCategory.json')).default;
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRoute = async (routeId: number) => {
|
const getRoute = async (routeId: number) => {
|
||||||
let data = {};
|
let data = {};
|
||||||
if (import.meta.env.DEV && import.meta.env.PROD) {
|
|
||||||
const response = await fetch(`${API_URL}/route/${routeId}`);
|
const response = await fetch(`${API_URL}/route/${routeId}`);
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
data = json;
|
data = json;
|
||||||
} else {
|
|
||||||
data = (await import('./mock/route.json')).default;
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -55,30 +41,18 @@ const getRoute = async (routeId: number) => {
|
||||||
|
|
||||||
const getSport = async (routeId: number, sportId: number) => {
|
const getSport = async (routeId: number, sportId: number) => {
|
||||||
let data = {};
|
let data = {};
|
||||||
if (import.meta.env.DEV && import.meta.env.PROD) {
|
|
||||||
const response = await fetch(`${API_URL}/route/${routeId}/${sportId}`);
|
const response = await fetch(`${API_URL}/route/${routeId}/${sportId}`);
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
data = json;
|
data = json;
|
||||||
} else {
|
|
||||||
data = (await import('./mock/sport.json')).default;
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
const downloadGPX = async (routeId: number, sportId: number) => {
|
|
||||||
// Code for downloading this gpx
|
|
||||||
}
|
|
||||||
|
|
||||||
const getPlacemarks = async (routeId: number, sportId: number) => {
|
const getPlacemarks = async (routeId: number, sportId: number) => {
|
||||||
let data = {};
|
let data = {};
|
||||||
if (import.meta.env.DEV && import.meta.env.PROD) {
|
|
||||||
const response = await fetch(`${API_URL}/getPlacemarks/${routeId}/${sportId}`);
|
const response = await fetch(`${API_URL}/getPlacemarks/${routeId}/${sportId}`);
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
data = json;
|
data = json;
|
||||||
} else {
|
|
||||||
data = (await import('./mock/placemark.json')).default;
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
1957
frontend/static/gpx/tidone.gpx
Normal file
1957
frontend/static/gpx/tidone.gpx
Normal file
File diff suppressed because it is too large
Load diff
1905
frontend/static/gpx/tidone_piedi.gpx
Normal file
1905
frontend/static/gpx/tidone_piedi.gpx
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue