mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-02-03 23:15:43 +00:00
12 lines
418 B
TypeScript
12 lines
418 B
TypeScript
const _basePath = '/api';
|
|
|
|
export function getFileUrl(assetId: string, isThumb?: boolean, isWeb?: boolean) {
|
|
const urlObj = new URL(`${window.location.origin}${_basePath}/asset/file/${assetId}`);
|
|
|
|
if (isThumb !== undefined && isThumb !== null)
|
|
urlObj.searchParams.append('isThumb', `${isThumb}`);
|
|
if (isWeb !== undefined && isWeb !== null) urlObj.searchParams.append('isWeb', `${isWeb}`);
|
|
|
|
return urlObj.href;
|
|
}
|