frontend: remove search on localstate, change to backend search use mongo passing searchTerm

This commit is contained in:
fadingNA
2024-11-18 00:06:18 -05:00
parent 13b91193cc
commit 0493352292
2 changed files with 18 additions and 14 deletions

View File

@@ -25,9 +25,10 @@ export async function getDocsWithPagination(
order = 'desc',
pageNumber = 1,
rowsPerPage = 10,
searchTerm = '',
): Promise<GetDocsResponse | null> {
try {
const query = `sort=${sort}&order=${order}&page=${pageNumber}&rows=${rowsPerPage}`;
const query = `sort=${sort}&order=${order}&page=${pageNumber}&rows=${rowsPerPage}&search=${searchTerm}`;
const response = await userService.getDocsWithPagination(query);
const data = await response.json();
const docs: Doc[] = [];