From 1b56aff3a625f95db48c2e241684856705628edd Mon Sep 17 00:00:00 2001 From: AminGhasempoor Date: Tue, 28 Nov 2023 16:36:58 +0330 Subject: [PATCH] LFFE-29 structured table of data --- .../loan-history/Form/HistoryForm/TableContent.jsx | 14 ++++++++++++-- src/core/data/sidebarMenu.jsx | 4 ++-- src/lib/app/hooks/useHistory.jsx | 6 +++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/components/dashboard/loan-history/Form/HistoryForm/TableContent.jsx b/src/components/dashboard/loan-history/Form/HistoryForm/TableContent.jsx index cd0569b..2459b47 100644 --- a/src/components/dashboard/loan-history/Form/HistoryForm/TableContent.jsx +++ b/src/components/dashboard/loan-history/Form/HistoryForm/TableContent.jsx @@ -22,11 +22,21 @@ const TableContent = ({rowId}) => { return ( - {error ? ({t("LoanHistory.Table_history_error")}) : + {error ? ({t("LoanHistory.Table_history_error")}) : (isLoading ? () : ( history_details.latest_histories.length === 0 ? ( {t("LoanHistory.empty_history_detail")} ) : ( , + icon: , selected: false, permission: "manage_navgan_loan", }, diff --git a/src/lib/app/hooks/useHistory.jsx b/src/lib/app/hooks/useHistory.jsx index 86d4d09..10aa3fc 100644 --- a/src/lib/app/hooks/useHistory.jsx +++ b/src/lib/app/hooks/useHistory.jsx @@ -13,7 +13,11 @@ const useHistory = (url) => { }) }; - const {data, isLoading, error} = useSWR(url, fetcher) + const {data, isLoading, error} = useSWR(url, fetcher, { + revalidateIfStale: false, + revalidateOnFocus: false, + revalidateOnReconnect: false + }) const history_details = data //swr config