11import { QSP } from "@/config/qsp" ;
2- import { useConfig } from "@/entities/config/get-config.query" ;
32import { StringParam , useQueryParam } from "use-query-params" ;
43
54type tPagination = {
@@ -33,8 +32,6 @@ const getVerifiedOffset = (offset: number, config: any) => {
3332} ;
3433
3534const usePagination = ( ) : [ tPagination , Function ] => {
36- const { data : config } = useConfig ( ) ;
37-
3835 const [ paginationInQueryString , setPaginationInQueryString ] = useQueryParam (
3936 QSP . PAGINATION ,
4037 StringParam
@@ -46,14 +43,14 @@ const usePagination = (): [tPagination, Function] => {
4643
4744 // Get the final pagination with verifyed values
4845 const pagination = {
49- limit : getVerifiedLimit ( parsedPagination ?. limit , config ) ,
50- offset : getVerifiedOffset ( parsedPagination ?. offset , config ) ,
46+ limit : getVerifiedLimit ( parsedPagination ?. limit , null ) ,
47+ offset : getVerifiedOffset ( parsedPagination ?. offset , null ) ,
5148 } ;
5249
5350 // Set the pagination in the QSP
5451 const setPagination = ( newPagination : tPagination ) => {
55- const newLimit = getVerifiedLimit ( newPagination ?. limit , config ) ;
56- const newOffset = getVerifiedOffset ( newPagination ?. offset , config ) ;
52+ const newLimit = getVerifiedLimit ( newPagination ?. limit , null ) ;
53+ const newOffset = getVerifiedOffset ( newPagination ?. offset , null ) ;
5754
5855 const newValidatedPagination = {
5956 limit : newLimit ,
0 commit comments