Files
f.bosin.ch/src/routes/[slug]/[[timestamp]]/i/+page.server.ts
2023-08-28 08:42:24 +02:00

14 lines
397 B
TypeScript

import { error } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
import { getZipName } from '$lib/util/links';
import { getMetadata } from '$lib/util/album';
export const load: PageServerLoad = async ({ params }) => {
try {
await getMetadata(getZipName(params));
} catch (e) {
throw error(404, 'Album not found');
}
throw error(400, 'No item specified');
};