From a2f788e617ce49cba3565e664b883e84e9e89f38 Mon Sep 17 00:00:00 2001 From: Claudia Malzer Date: Tue, 14 May 2024 11:22:04 +0200 Subject: [PATCH] ERM-3220 Update pagination mechanisms for MCLs to work without stats * remove comments * add resetPageStore function --- lib/hooks/index.js | 1 + lib/hooks/useFetchCurrentAndNext.js | 1 - lib/hooks/useLocalPageStore.js | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/hooks/index.js b/lib/hooks/index.js index 8a18117f..e21d6a18 100644 --- a/lib/hooks/index.js +++ b/lib/hooks/index.js @@ -12,6 +12,7 @@ export { default as useSingleFetchInterfaceCredentials } from './useSingleFetchI export { default as useChunkedCQLFetch } from './useChunkedCQLFetch'; export { default as useChunkedUsers } from './useChunkedUsers'; export { default as useFetchCurrentAndNext } from './useFetchCurrentAndNext'; +export { default as useLocalPageStore } from './useLocalPageStore'; export { default as useParallelBatchFetch } from './useParallelBatchFetch'; export { default as usePrevNextPagination } from './usePrevNextPagination'; export { default as usePrevious } from './usePrevious'; diff --git a/lib/hooks/useFetchCurrentAndNext.js b/lib/hooks/useFetchCurrentAndNext.js index 5e6ac913..7d21b769 100644 --- a/lib/hooks/useFetchCurrentAndNext.js +++ b/lib/hooks/useFetchCurrentAndNext.js @@ -6,7 +6,6 @@ import { generateKiwtQueryParams } from '@k-int/stripes-kint-components'; const defaultParams = { page: 1 }; const useFetchCurrentAndNext = ({ - // id, // for future use / local zustand store params = {}, path = '', keyArray = [], diff --git a/lib/hooks/useLocalPageStore.js b/lib/hooks/useLocalPageStore.js index 8a2c3bc4..58896985 100644 --- a/lib/hooks/useLocalPageStore.js +++ b/lib/hooks/useLocalPageStore.js @@ -12,6 +12,7 @@ const useLocalPageStore = create( return { ...state, pageStore: { ...state.pageStore, [key]: page } }; }), + resetPageStore: () => set({ pageStore: {} }), }), );