From 41a283e25f033da298e025e61df02ecbef416330 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sat, 5 Aug 2023 21:53:08 +0200 Subject: [PATCH] Updated the RequestUtil.js --- client/src/common/utils/RequestUtil.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/common/utils/RequestUtil.js b/client/src/common/utils/RequestUtil.js index 22d1a7c..72ca0f4 100644 --- a/client/src/common/utils/RequestUtil.js +++ b/client/src/common/utils/RequestUtil.js @@ -1,6 +1,5 @@ -const DEFAULT_URL = process.env.NODE_ENV === 'production' ? "https://tools-api.gnmyt.dev/" : "http://localhost:7182/"; - -const getURL = () => localStorage.getItem("url") || DEFAULT_URL; +const getURL = () => process.env.NODE_ENV === 'production' ? (localStorage.getItem("url") || "https://tools-api.gnmyt.dev/") + : "http://localhost:7182/"; // Run a plain request with all default values export const request = (path, method = "GET", body = {}, headers = {}) => {