fixes trail filter categories

This commit is contained in:
Christian Beutel
2024-09-14 12:28:15 +02:00
parent 4263c32ca7
commit ca34e6db95
6 changed files with 8 additions and 7 deletions

View File

@@ -157,7 +157,7 @@
on:change={() => setCategoryFilter(category)}
/>
<label for="{category.name}-checkbox" class="ms-2 text-sm"
>{category.name}</label
>{$_(category.name)}</label
>
</div>
{/each}

View File

@@ -111,7 +111,7 @@
"list": "{n, plural, =1 {Liste} other {Listen}}",
"list-not-shared": "",
"list-saved-successfully": "",
"list-share-warning": "Sharing a list automatically shares all trails contained in it.",
"list-share-warning": "",
"list-share-warning-update": "",
"location": "Standort",
"login": "Login",

View File

@@ -111,7 +111,7 @@
"list": "{n, plural, =1 {List} other {Lists}}",
"list-not-shared": "Not shared with anyone",
"list-saved-successfully": "List saved successfully",
"list-share-warning": "",
"list-share-warning": "Sharing a list automatically shares all trails contained in it.",
"list-share-warning-update": "Added trails will be shared with everyone that has access to this list.",
"location": "Location",
"login": "Login",

View File

@@ -18,5 +18,5 @@ export async function categories_index(f: (url: RequestInfo | URL, config?: Requ
categories.set(response);
return response;
return response as Category[];
}

View File

@@ -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 }
};
};

View File

@@ -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()}