mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 17:25:35 +03: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;
|
|
}
|