feat(search): add order: 'relevance' for search

This commit is contained in:
haitao(lj) 2022-10-14 12:25:11 +08:00
parent 5dd8d1246f
commit 0ca4413366
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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,