This commit is contained in:
parent
ba817bf72c
commit
c038bcc2a1
1 changed files with 6 additions and 6 deletions
|
@ -2,7 +2,7 @@ const API_URL = "http://localhost:8000/api";
|
||||||
|
|
||||||
const getAllRoutes = async () => {
|
const getAllRoutes = async () => {
|
||||||
let data = [];
|
let data = [];
|
||||||
if (import.meta.env.PROD) {
|
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;
|
||||||
|
@ -15,7 +15,7 @@ const getAllRoutes = async () => {
|
||||||
|
|
||||||
const getRouteCategories = async () => {
|
const getRouteCategories = async () => {
|
||||||
let data = [];
|
let data = [];
|
||||||
if (import.meta.env.PROD) {
|
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;
|
||||||
|
@ -28,7 +28,7 @@ const getRouteCategories = async () => {
|
||||||
|
|
||||||
const getRouteByCategory = async (categoryId: number) => {
|
const getRouteByCategory = async (categoryId: number) => {
|
||||||
let data = [];
|
let data = [];
|
||||||
if (import.meta.env.PROD) {
|
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;
|
||||||
|
@ -41,7 +41,7 @@ const getRouteByCategory = async (categoryId: number) => {
|
||||||
|
|
||||||
const getRoute = async (routeId: number) => {
|
const getRoute = async (routeId: number) => {
|
||||||
let data = {};
|
let data = {};
|
||||||
if (import.meta.env.PROD) {
|
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;
|
||||||
|
@ -55,7 +55,7 @@ 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.PROD) {
|
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;
|
||||||
|
@ -72,7 +72,7 @@ const downloadGPX = async (routeId: number, sportId: number) => {
|
||||||
|
|
||||||
const getPlacemarks = async (routeId: number, sportId: number) => {
|
const getPlacemarks = async (routeId: number, sportId: number) => {
|
||||||
let data = {};
|
let data = {};
|
||||||
if (import.meta.env.PROD) {
|
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;
|
||||||
|
|
Loading…
Reference in a new issue