Skip to content

Commit

Permalink
refactored search to use advanced route
Browse files Browse the repository at this point in the history
  • Loading branch information
AmasiaNalbandian committed Mar 10, 2022
1 parent 46685e9 commit 999dc6e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/web/src/components/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 999dc6e

Please sign in to comment.