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











                                                                                  
import { CharacterSort, type CharacterFilterInput } 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, CharacterSort.Name),
		filter: parseFilter<CharacterFilterInput>(url.searchParams),
		pagination: parsePaginationData(url.searchParams)
	};
}