From a24c037b322dbdc56cbaae3d3fe6f5fa1e819972 Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Sat, 7 May 2022 13:17:26 -0500 Subject: New fix for fixing URLs with '//' (#105) --- src/api/apiBase.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/api') diff --git a/src/api/apiBase.ts b/src/api/apiBase.ts index 7ed3616a8..c4acb5f68 100644 --- a/src/api/apiBase.ts +++ b/src/api/apiBase.ts @@ -9,6 +9,7 @@ import { LOCAL_SERVER, SERVER_NOT_LOADED, } from '../config'; +import { fixUrl } from '../helpers/url-helpers'; // Note: This cannot be used from the internal-server since we are not running within the context of a browser window const apiBase = (withVersion = true) => { @@ -28,13 +29,13 @@ const apiBase = (withVersion = true) => { }` : (window as any).ferdium.stores.settings.all.app.server; - return withVersion ? `${url}/${API_VERSION}` : url; + return fixUrl(withVersion ? `${url}/${API_VERSION}` : url); }; export default apiBase; export function termsBase() { - return (window as any).ferdium.stores.settings.all.app.server !== LIVE_FRANZ_API + return fixUrl((window as any).ferdium.stores.settings.all.app.server !== LIVE_FRANZ_API ? (window as any).ferdium.stores.settings.all.app.server - : DEV_API_FRANZ_WEBSITE; + : DEV_API_FRANZ_WEBSITE); } -- cgit v1.2.3-54-g00ecf