fixes trail filter categories
This commit is contained in:
@@ -29,9 +29,10 @@ export const load: ServerLoad = async ({ params, locals, url, fetch }) => {
|
||||
const page = url.searchParams.get("page") ?? "1";
|
||||
|
||||
const response = await trails_search_filter(filter, parseInt(page), fetch);
|
||||
await categories_index(fetch)
|
||||
|
||||
const categories = await categories_index(fetch)
|
||||
|
||||
return {
|
||||
categories,
|
||||
filter: filter, pagination: { page: response.page, totalPages: response.totalPages }
|
||||
};
|
||||
};
|
||||
@@ -43,7 +43,7 @@
|
||||
class="grid grid-cols-1 md:grid-cols-[300px_1fr] items-start gap-8 max-w-7xl mx-6 md:mx-auto"
|
||||
>
|
||||
<TrailFilterPanel
|
||||
categories={$categories}
|
||||
categories={$page.data.categories}
|
||||
{filter}
|
||||
{filterExpanded}
|
||||
on:update={() => handleFilterUpdate()}
|
||||
|
||||
Reference in New Issue
Block a user