From b9c113357d5ae575e461d940d4d6effcbae7b13d Mon Sep 17 00:00:00 2001 From: Ashish Deo Date: Fri, 13 Sep 2024 18:51:30 +0530 Subject: [PATCH] TP-74655 | hotfix (#1114) --- src/pages/CaseDetails/components/AllDocuments/actions.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pages/CaseDetails/components/AllDocuments/actions.ts b/src/pages/CaseDetails/components/AllDocuments/actions.ts index 1bdfc4f0..b6f724bf 100644 --- a/src/pages/CaseDetails/components/AllDocuments/actions.ts +++ b/src/pages/CaseDetails/components/AllDocuments/actions.ts @@ -2,6 +2,8 @@ import axiosInstance, { ApiKeys, getApiUrl, logError } from '@cp/src/utils/ApiHe import { isFunction } from '@cp/src/utils/commonUtils'; import { setBankStatementStatus } from './reducer/bankStatementSlice'; import { Dispatch } from '@reduxjs/toolkit'; +import store from '@cp/src/store'; +import { Roles } from '@cp/src/pages/auth/constants/AuthConstants'; export const getBankStatementResponse = async ( lan: string, @@ -28,6 +30,10 @@ export const getBankStatementResponse = async ( export const getBankStatementStatus = (lan: string, customerId: string) => (dispatch: Dispatch) => { const url = getApiUrl(ApiKeys.GET_BANK_STATEMENT_STATUS); + const isBankStatementAccessible = store.getState().common?.userData?.roles?.includes(Roles.ROLE_BANK_STATEMENT_ACCESS); + if (!isBankStatementAccessible) { + return; + } axiosInstance .get(url, { headers: {