fix: make search work

This commit is contained in:
Max Richter
2025-11-07 18:58:23 +01:00
parent 97c5b7f93c
commit 6c6b69a46a
10 changed files with 18 additions and 17 deletions

View File

@@ -16,7 +16,7 @@ export const handler: Handlers<
const recipes = await listResources<RecipeResource>("recipes");
const searchParams = parseResourceUrl(req.url);
const searchResults = searchParams &&
await searchResource({ ...searchParams, types: ["recipe"] });
await searchResource({ ...searchParams, types: ["recipes"] });
return ctx.render({ recipes, searchResults });
},
};
@@ -32,10 +32,10 @@ export default function Greet(
url={props.url}
title="Recipes"
searchResults={searchResults}
context={{ type: "recipe" }}
context={{ type: "recipes" }}
>
<RedirectSearchHandler />
<KMenu type="main" context={{ type: "recipe" }} />
<KMenu type="main" context={{ type: "recipes" }} />
<header class="flex gap-4 items-center mb-2 lg:mb-5 md:hidden">
<a
class="px-4 lg:ml-4 py-2 bg-gray-300 text-gray-800 rounded-lg flex items-center gap-1"