summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/src/routes/comics/+page.ts
blob: 455880426188f9879de4e8e259228acdf2e5ddec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { ComicSort, type ComicFilterInput } from '$gql/graphql';
import { parseFilter, parsePaginationData, parseSortData } from '$lib/Navigation';

export const trailingSlash = 'always';

export function load({ url }: { url: URL; params: Record<string, string> }) {
	return {
		sort: parseSortData(url.searchParams, ComicSort.Title),
		filter: parseFilter<ComicFilterInput>(url.searchParams),
		pagination: parsePaginationData(url.searchParams, 24)
	};
}