diff options
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/apiBase.ts | 7 |
1 files changed, 4 insertions, 3 deletions
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 { | |||
9 | LOCAL_SERVER, | 9 | LOCAL_SERVER, |
10 | SERVER_NOT_LOADED, | 10 | SERVER_NOT_LOADED, |
11 | } from '../config'; | 11 | } from '../config'; |
12 | import { fixUrl } from '../helpers/url-helpers'; | ||
12 | 13 | ||
13 | // Note: This cannot be used from the internal-server since we are not running within the context of a browser window | 14 | // Note: This cannot be used from the internal-server since we are not running within the context of a browser window |
14 | const apiBase = (withVersion = true) => { | 15 | const apiBase = (withVersion = true) => { |
@@ -28,13 +29,13 @@ const apiBase = (withVersion = true) => { | |||
28 | }` | 29 | }` |
29 | : (window as any).ferdium.stores.settings.all.app.server; | 30 | : (window as any).ferdium.stores.settings.all.app.server; |
30 | 31 | ||
31 | return withVersion ? `${url}/${API_VERSION}` : url; | 32 | return fixUrl(withVersion ? `${url}/${API_VERSION}` : url); |
32 | }; | 33 | }; |
33 | 34 | ||
34 | export default apiBase; | 35 | export default apiBase; |
35 | 36 | ||
36 | export function termsBase() { | 37 | export function termsBase() { |
37 | return (window as any).ferdium.stores.settings.all.app.server !== LIVE_FRANZ_API | 38 | return fixUrl((window as any).ferdium.stores.settings.all.app.server !== LIVE_FRANZ_API |
38 | ? (window as any).ferdium.stores.settings.all.app.server | 39 | ? (window as any).ferdium.stores.settings.all.app.server |
39 | : DEV_API_FRANZ_WEBSITE; | 40 | : DEV_API_FRANZ_WEBSITE); |
40 | } | 41 | } |