feat: search for multiple words (#4362)
This commit is contained in:
parent
6c088e09d9
commit
03267d6d37
1 changed files with 6 additions and 4 deletions
|
|
@ -17,10 +17,12 @@ const SearchBar = () => {
|
||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (queryText !== "") {
|
if (queryText !== "") {
|
||||||
memoFilterStore.removeFilter((f) => f.factor === "contentSearch");
|
const words = queryText.split(" ");
|
||||||
memoFilterStore.addFilter({
|
words.forEach((word) => {
|
||||||
factor: "contentSearch",
|
memoFilterStore.addFilter({
|
||||||
value: queryText,
|
factor: "contentSearch",
|
||||||
|
value: word,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
setQueryText("");
|
setQueryText("");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue