mirror of
https://github.com/immich-app/immich.git
synced 2025-03-28 22:49:06 +02:00
* feat: explore * chore: generate open api * styling explore page * styling no result page * style overlay * style: bluring text on thumbnail card for readability * explore page tweaks * fix(web): search urls * feat(web): use objects for things * feat(server): filter by motion, sort by createdAt * More styling * better navigation --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com> Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
28 lines
603 B
TypeScript
28 lines
603 B
TypeScript
import { redirect } from '@sveltejs/kit';
|
|
import type { PageServerLoad } from './$types';
|
|
|
|
export const load = (async ({ locals, parent, url }) => {
|
|
const { user } = await parent();
|
|
if (!user) {
|
|
throw redirect(302, '/auth/login');
|
|
}
|
|
|
|
const term = url.searchParams.get('q') || undefined;
|
|
const { data: results } = await locals.api.searchApi.search(
|
|
term,
|
|
undefined,
|
|
undefined,
|
|
undefined,
|
|
undefined,
|
|
undefined,
|
|
undefined,
|
|
undefined,
|
|
undefined,
|
|
undefined,
|
|
undefined,
|
|
undefined,
|
|
{ params: url.searchParams }
|
|
);
|
|
return { user, term, results };
|
|
}) satisfies PageServerLoad;
|