summaryrefslogblamecommitdiffstatshomepage
path: root/frontend/src/routes/archives/+page.ts
blob: 88acadeb05c5cd931e6d7b1b236d83aebe713559 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                                  
import { ArchiveSort, type ArchiveFilterInput } 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, ArchiveSort.Path),
		filter: parseFilter<ArchiveFilterInput>(url.searchParams),
		pagination: parsePaginationData(url.searchParams, 24)
	};
}