From f0c2825dea9b868c18dec458a0e2e112f0115e16 Mon Sep 17 00:00:00 2001 From: Aman Chaturvedi Date: Fri, 30 Jun 2023 20:29:17 +0530 Subject: [PATCH] TP-31863 | fixes --- src/action/profileActions.ts | 14 +++++++------- src/common/Constants.ts | 2 +- src/reducer/profileSlice.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/action/profileActions.ts b/src/action/profileActions.ts index c9eb5c57..7e030e1b 100644 --- a/src/action/profileActions.ts +++ b/src/action/profileActions.ts @@ -39,16 +39,16 @@ export const getSelfieDocument = () => (dispatch: AppDispatch) => { axiosInstance .get(url) .then((res) => { - if (res.data?.documents?.[0]?.originalDocumentUri) { + if (res.data?.documents?.[0]) { const { documents, agencyName, agencyCode } = res.data; - const { originalDocumentUri, updatedAt, approvalStatus } = documents[0]; + const { originalDocumentUri, updatedAt, approvalStatus } = documents?.[0] || {}; dispatch( setOriginalImageDetails({ - originalImageUri: originalDocumentUri, - validationDate: updatedAt, - approvalStatus, - agencyName, - agencyCode, + originalImageUri: originalDocumentUri || '', + validationDate: updatedAt || '', + approvalStatus: approvalStatus || ImageApprovalStatus.REJECTED, + agencyName: agencyName || '', + agencyCode: agencyCode || '', }) ); } else { diff --git a/src/common/Constants.ts b/src/common/Constants.ts index 54a5d20a..703ba1e7 100644 --- a/src/common/Constants.ts +++ b/src/common/Constants.ts @@ -618,4 +618,4 @@ export const REQUEST_TO_UNBLOCK_FOR_IMPERSONATION = [ getApiUrl(ApiKeys.LOGOUT), ]; -export const NAVI_AGENCY_CODE = 1000; +export const NAVI_AGENCY_CODE = '1000'; diff --git a/src/reducer/profileSlice.ts b/src/reducer/profileSlice.ts index 1c48744c..3ea152ee 100644 --- a/src/reducer/profileSlice.ts +++ b/src/reducer/profileSlice.ts @@ -15,7 +15,7 @@ const initialState = { showReviewImageModal: false, approvalStatus: ImageApprovalStatus.NOT_INITIATED, agencyName: '', - agencyCode: -1, + agencyCode: '', }; export const profileSlice = createSlice({