summaryrefslogtreecommitdiffstatshomepage
path: root/frontend/src/routes/worlds/+page.ts
blob: 3b85f4cff3853f1be24dce013fe7daa3028c88b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { WorldSort, type WorldFilterInput } 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, WorldSort.Name),
		filter: parseFilter<WorldFilterInput>(url.searchParams),
		pagination: parsePaginationData(url.searchParams)
	};
}