TP-34976 | Geolocation feedback API integration

This commit is contained in:
Aman Chaturvedi
2023-08-24 17:26:34 +05:30
parent 101b9db39c
commit 34603b7dcc
9 changed files with 57 additions and 42 deletions

View File

@@ -70,7 +70,7 @@ API_URLS[ApiKeys.GENERATE_PAYMENT_LINK] = '/payments/send-payment-link';
API_URLS[ApiKeys.ADDRESSES_GEOLOCATION] = '/addresses-geolocations';
API_URLS[ApiKeys.NEW_ADDRESS] = '/addresses';
API_URLS[ApiKeys.GET_SIGNED_URL] = '/cases/get-signed-urls';
API_URLS[ApiKeys.CASE_UNIFIED_DETAILS] = '/v2/collection-cases/unified-details/{loanAccountNumber}';
API_URLS[ApiKeys.CASE_UNIFIED_DETAILS] = '/v3/collection-cases/unified-details/{loanAccountNumber}';
API_URLS[ApiKeys.UNGROUPED_ADDRESSES] = '/addresses/ungrouped/{loanAccountNumber}';
API_URLS[ApiKeys.PAST_FEEDBACK] = '/feedback';
API_URLS[ApiKeys.PAST_FEEDBACK_ON_ADDRESSES] = '/feedback/v2';
@@ -210,7 +210,7 @@ axiosInstance.interceptors.response.use(
}
const { config, response } = error;
logError(error as Error, config?.baseURL + config?.url);
const start = response.config.headers['request-start-time'];
const start = response?.config?.headers['request-start-time'];
const end = Date.now();
const milliseconds = end - Number(start);
sendApiToClickstreamEvent(response, milliseconds, false);
@@ -218,7 +218,7 @@ axiosInstance.interceptors.response.use(
Number
);
if (
config.headers.donotHandleError ||
config?.headers?.donotHandleError ||
donotHandleErrorOnStatusCode.includes(error.response.status)
) {
return Promise.reject(error);