mirror of
https://github.com/owntracks/frontend.git
synced 2026-05-15 03:56:32 +00:00
Return URL instance from getApiUrl
This commit is contained in:
@@ -6,7 +6,7 @@ export const getApiUrl = path => {
|
||||
? config.api.baseUrl.slice(1)
|
||||
: config.api.baseUrl;
|
||||
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
||||
return `${normalizedBaseUrl}${normalizedPath}`;
|
||||
return new URL(`${normalizedBaseUrl}${normalizedPath}`);
|
||||
};
|
||||
|
||||
export const isIsoDate = s => ISO_DATE_REGEXP.test(s);
|
||||
|
||||
Reference in New Issue
Block a user