correct link generation

This commit is contained in:
Johannes Kirschbauer 2024-01-10 13:18:37 +01:00
parent 978c9ae45a
commit 04ca34eb06
No known key found for this signature in database

View File

@ -80,7 +80,12 @@ export function SearchInput(props: SearchInputProps) {
if (reason === "reset") {
console.log({ value, reason });
if (value) {
router.push(`/f/${value.split(".").join("/")}`.split(" ")[0]);
const target = data.find((d) => d.meta.title === value);
if (target) {
router.push(`/f/${target.meta.path.join("/")}`);
} else {
handleSubmit(value);
}
} else {
handleSubmit(value);
}