Updated the RequestUtil.js

This commit is contained in:
Mathias Wagner 2023-08-05 21:53:08 +02:00
parent 96965bbb1d
commit 41a283e25f
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -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 = {}) => {