diff --git a/src/context/CapturesContext.js b/src/context/CapturesContext.js index 931fd5d42..d1a8264e2 100644 --- a/src/context/CapturesContext.js +++ b/src/context/CapturesContext.js @@ -59,10 +59,11 @@ export function CapturesProvider(props) { useEffect(() => { handleQuerySearchParams({ - rowsPerPage, - page, - order, - orderBy, + rowsPerPage: + rowsPerPage === DEFAULT_ROWS_PER_PAGE ? undefined : rowsPerPage, + page: page === DEFAULT_PAGE ? undefined : page, + order: order === DEFAULT_ORDER ? undefined : order, + orderBy: porderByage === DEFAULT_ORDER_BY ? undefined : orderBy, ...filter.toSearchParams(), }); diff --git a/src/context/GrowerContext.js b/src/context/GrowerContext.js index 0d05d7ad2..566a35717 100644 --- a/src/context/GrowerContext.js +++ b/src/context/GrowerContext.js @@ -55,8 +55,9 @@ export function GrowerProvider(props) { useEffect(() => { if (searchParams) { handleQuerySearchParams({ - pageSize, - currentPage, + pageSize: pageSize === DEFAULT_PAGE_SIZE ? undefined : pageSize, + currentPage: + currentPage === DEFAULT_CURRENT_PAGE ? undefined : currentPage, ...filter.toSearchParams(), }); } diff --git a/src/context/VerifyContext.js b/src/context/VerifyContext.js index 5d4fd7f14..af0ec7812 100644 --- a/src/context/VerifyContext.js +++ b/src/context/VerifyContext.js @@ -75,8 +75,9 @@ export function VerifyProvider(props) { useEffect(() => { if (searchParams) { handleQuerySearchParams({ - pageSize, - currentPage, + pageSize: pageSize === DEFAULT_PAGE_SIZE ? undefined : pageSize, + currentPage: + currentPage === DEFAULT_CURRENT_PAGE ? undefined : currentPage, ...filter.toSearchParams(), }); }