From 999dc6ec46525a09d5d198db568b55a4066c9ab2 Mon Sep 17 00:00:00 2001 From: AmasiaNalbandian Date: Thu, 10 Mar 2022 00:10:28 -0500 Subject: [PATCH] refactored search to use advanced route --- src/web/src/components/SearchResults.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/web/src/components/SearchResults.tsx b/src/web/src/components/SearchResults.tsx index dad2c26f26..ce4ac9020b 100644 --- a/src/web/src/components/SearchResults.tsx +++ b/src/web/src/components/SearchResults.tsx @@ -59,7 +59,11 @@ const SearchResults = () => { const [totalPosts, setTotalPosts] = useState(0); const prepareUrl = (index: number) => - `${searchServiceUrl}?text=${encodeURIComponent(textParam)}&filter=${filter}&page=${index}`; + // `${searchServiceUrl}?text=${encodeURIComponent(textParam)}&filter=${filter}&page=${index}`; + + `${searchServiceUrl}/advanced/?${filter === 'author' ? `author` : `post`}=${encodeURIComponent( + textParam + )}&page=${index}`; // We only bother doing the request if we have something to search for. const shouldFetch = () => textParam.length > 0;