mirror of
https://github.com/hsjobeki/noogle.git
synced 2024-12-24 14:32:15 +03:00
correct link generation
This commit is contained in:
parent
4e54cf5989
commit
4eb74208df
@ -81,7 +81,12 @@ export function SearchInput(props: SearchInputProps) {
|
||||
if (reason === "reset" && e) {
|
||||
console.log({ e, 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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user