Fixed API_URL handling.
This commit is contained in:
1 parent
f985b4f9a5
commit
9ced9ac85a
3 files changed
+40
-7
No files matched your search
+2
-6
@@ -39,12 +39,8 @@ export function getApiUrl(url: string, options: ApiUrlOptions = {}) {
|
||||
}
|
||||
|
||||
const { apiUrl = process.env.apiUrl || '', basePath = process.env.basePath || '' } = options;
|
||||
const useApiUrl = apiUrl && !isAppRoute(url);
|
||||
const baseUrl = useApiUrl
|
||||
? isAbsoluteUrl(apiUrl)
|
||||
? apiUrl
|
||||
: joinPath(basePath, apiUrl)
|
||||
: joinPath(basePath, '/api');
|
||||
const useApiUrl = apiUrl && !isAbsoluteUrl(apiUrl) && !isAppRoute(url);
|
||||
const baseUrl = useApiUrl ? joinPath(basePath, apiUrl) : joinPath(basePath, '/api');
|
||||
|
||||
return joinPath(baseUrl, url);
|
||||
}
|
||||
Reference in new issue
Block a user