High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(web): use id instead of assetId (#2643)
Michel Heusschen47673dd7730d
diff --git a/web/src/lib/stores/asset-interaction.store.ts b/web/src/lib/stores/asset-interaction.store.tsindex bc3e3bea35..3b05258fd1 100644--- a/web/src/lib/stores/asset-interaction.store.ts+++ b/web/src/lib/stores/asset-interaction.store.ts@@ -57,7 +57,7 @@ function createAssetInteractionStore() {};const setViewingAssetId = async (id: string) => {- const { data } = await api.assetApi.getAssetById({ assetId: id });+ const { data } = await api.assetApi.getAssetById({ id });viewingAssetStoreState.set(data);isViewingAssetStoreState.set(true);};diff --git a/web/src/routes/(user)/share/[key]/photos/[assetId]/+page.server.ts b/web/src/routes/(user)/share/[key]/photos/[assetId]/+page.server.tsindex f5672b1c10..af5e6b6528 100644--- a/web/src/routes/(user)/share/[key]/photos/[assetId]/+page.server.ts+++ b/web/src/routes/(user)/share/[key]/photos/[assetId]/+page.server.ts@@ -1,18 +1,19 @@-export const prerender = false;-import { error } from '@sveltejs/kit';import type { PageServerLoad } from './$types';export const load = (async ({ params, locals: { api } }) => {- try {- const { key, assetId } = params;- const { data: asset } = await api.assetApi.getAssetById({ assetId, key });+ const { key, assetId } = params;+ const { data: asset } = await api.assetApi.getAssetById({ id: assetId, key });- if (!asset) {- return error(404, 'Asset not found');- }- return { asset, key };- } catch (e) {- console.log('Error', e);+ if (!asset) {+ throw error(404, 'Asset not found');}++ return {+ asset,+ key,+ meta: {+ title: 'Public Share'+ }+ };}) satisfies PageServerLoad;