mirror of https://gitee.com/answerdev/answer.git
feat(search): add order: 'relevance' for search
This commit is contained in:
parent
5dd8d1246f
commit
0ca4413366
|
@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
|
|||
|
||||
import { QueryGroup } from '@answer/components';
|
||||
|
||||
const sortBtns = ['newest', 'active', 'score'];
|
||||
const sortBtns = ['relevance', 'newest', 'active', 'score'];
|
||||
|
||||
interface Props {
|
||||
count: number;
|
||||
|
|
|
@ -13,7 +13,7 @@ const Index = () => {
|
|||
const [searchParams] = useSearchParams();
|
||||
const page = searchParams.get('page') || 1;
|
||||
const q = searchParams.get('q') || '';
|
||||
const order = searchParams.get('order') || 'newest';
|
||||
const order = searchParams.get('order') || 'relevance';
|
||||
|
||||
const { data, isLoading } = useSearch({
|
||||
q,
|
||||
|
|
Loading…
Reference in New Issue