diff --git a/src/action/dataActions.ts b/src/action/dataActions.ts index b15f3d22..ad044591 100644 --- a/src/action/dataActions.ts +++ b/src/action/dataActions.ts @@ -140,6 +140,7 @@ interface ISignedRequestItem { caseId: string; unSignedUri?: string; skipFirebaseUpdate?: boolean; + retryForDocumentsItem?: string; } export type ISignedRequest = ISignedRequestItem[]; @@ -211,6 +212,7 @@ async function makeBulkSignedApiRequest( .post(url, payload, { headers: { donotHandleError: true, + 'X-Doc-Type': payload?.[0]?.retryForDocumentsItem || '', }, }) .then((response) => { diff --git a/src/action/feedbackActions.ts b/src/action/feedbackActions.ts index e38b4274..5d486026 100644 --- a/src/action/feedbackActions.ts +++ b/src/action/feedbackActions.ts @@ -9,6 +9,7 @@ interface IPastFeedbacksPayload { page_size: number; customerRecahble: boolean; addressReferenceIds?: string; // required to fetch past feedback on addresses + isGeolocationFeedback: boolean; } export interface IFilterPayload { @@ -58,6 +59,9 @@ export const getPastFeedbacksOnAddresses = (pastFeedbackPayload: IPastFeedbacksP return axiosInstance .get(url, { params: payload, + headers: { + 'X-Feedback-Source': pastFeedbackPayload.isGeolocationFeedback ? 'GEO_LOCATION' : 'ADDRESS', + }, }) .then((response) => { if (response?.data) { diff --git a/src/components/utlis/commonFunctions.ts b/src/components/utlis/commonFunctions.ts index eb27a224..c41a5860 100644 --- a/src/components/utlis/commonFunctions.ts +++ b/src/components/utlis/commonFunctions.ts @@ -554,6 +554,7 @@ export const checkUrlData = async (document: IDocumentItem | IDocument, caseId: caseId: caseId, caseType: CaseAllocationType.COLLECTION_CASE, unSignedUri: document?.unsignedUri, + retryForDocumentsItem: document?.type, }, ]; const response = await getSignedApi(signedRequestPayload); diff --git a/src/hooks/useFetchDocument.ts b/src/hooks/useFetchDocument.ts index 57da51bd..07ed27b0 100644 --- a/src/hooks/useFetchDocument.ts +++ b/src/hooks/useFetchDocument.ts @@ -91,7 +91,7 @@ const useFetchDocument = ( retryForDocumentsItem ); - const { referenceId, unSignedUri} = imageDocument || {}; + const { referenceId, unSignedUri } = imageDocument || {}; (async () => { if (!referenceId) { setDocumentObj((documentObj) => ({ @@ -110,7 +110,8 @@ const useFetchDocument = ( documentReferenceId: referenceId, caseId: '' + caseDetailObj?.caseId, caseType: caseDetailObj?.caseType, - unSignedUri: unSignedUri + unSignedUri: unSignedUri, + retryForDocumentsItem, }, ]; diff --git a/src/screens/addressGeolocation/GeolocationOldFeedbacks.tsx b/src/screens/addressGeolocation/GeolocationOldFeedbacks.tsx index a454135e..e6cdf923 100644 --- a/src/screens/addressGeolocation/GeolocationOldFeedbacks.tsx +++ b/src/screens/addressGeolocation/GeolocationOldFeedbacks.tsx @@ -61,6 +61,7 @@ const GeolocationOldFeedbacks: React.FC = ({ route: ro page_size: FEEDBACK_PER_PAGE, customerRecahble: false, addressReferenceIds: addressReferenceIds?.join(','), + isGeolocationFeedback: true, }) .then((res: { data: IFeedback[]; totalPage: number } | GenericType) => { if (res?.data?.length) { diff --git a/src/screens/allCases/CaseItemAvatar.tsx b/src/screens/allCases/CaseItemAvatar.tsx index 8540cd69..54c3d34d 100644 --- a/src/screens/allCases/CaseItemAvatar.tsx +++ b/src/screens/allCases/CaseItemAvatar.tsx @@ -61,7 +61,7 @@ const CaseItemAvatar: React.FC = ({ retryForDocumentsItem ); - const { referenceId, unSignedUri} = imageDocument || {}; + const { referenceId, unSignedUri } = imageDocument || {}; if (!referenceId) { return; @@ -77,7 +77,8 @@ const CaseItemAvatar: React.FC = ({ documentReferenceId: referenceId, caseId: '' + caseDetail?.caseId, caseType: caseDetail?.caseType, - unSignedUri: unSignedUri + unSignedUri: unSignedUri, + retryForDocumentsItem }, ]; const response = await getSignedApi(signedRequestPayload, enableRetry);