Skip to content

Commit cf24086

Browse files
authored
Removed useless call to get config (#5876)
1 parent f726497 commit cf24086

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

frontend/app/src/shared/hooks/usePagination.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { QSP } from "@/config/qsp";
2-
import { useConfig } from "@/entities/config/get-config.query";
32
import { StringParam, useQueryParam } from "use-query-params";
43

54
type tPagination = {
@@ -33,8 +32,6 @@ const getVerifiedOffset = (offset: number, config: any) => {
3332
};
3433

3534
const 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

Comments
 (0)