fix search extended pagination

This commit is contained in:
“spicecat” 2022-08-02 21:20:28 -05:00
commit 815f090a12

View file

@ -9,7 +9,7 @@ import { searchQuestions } from 'services/questionsServices';
export default function Search() {
const [searchParams] = useSearchParams();
const getData = async () => {
const getData = async ({ question_id }) => {
let match = {};
const regexMatch = {}
const time = {};
@ -32,7 +32,7 @@ export default function Search() {
const title = searchParams.get('title');
if (title) regexMatch.title = title.replaceAll(' ', '|');
const { questions } = await searchQuestions({ regexMatch, match })
const { questions } = await searchQuestions({ after: question_id, regexMatch, match })
return questions;
}