fixes trail filter categories
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -18,5 +18,5 @@ export async function categories_index(f: (url: RequestInfo | URL, config?: Requ
|
||||
|
||||
categories.set(response);
|
||||
|
||||
return response;
|
||||
return response as Category[];
|
||||
}
|
||||
@@ -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