NTP-7181 | SWW logging added
This commit is contained in:
@@ -6,10 +6,14 @@ import { GLOBAL } from '../../constants/Global';
|
||||
import { _map, compareUrl } from '../../../RN-UI-LIB/src/utlis/common';
|
||||
import { BASE_AV_APP_URL } from '../../constants/config';
|
||||
import { logError } from './errorUtils';
|
||||
import { sendApiToClickstreamEvent } from '../../services/clickstreamEventService';
|
||||
import {
|
||||
addClickstreamEvent,
|
||||
sendApiToClickstreamEvent,
|
||||
} from '../../services/clickstreamEventService';
|
||||
import { handleLogout } from '../../action/authActions';
|
||||
import {
|
||||
API_ERROR_MESSAGE,
|
||||
CLICKSTREAM_EVENT_NAMES,
|
||||
REQUEST_TO_UNBLOCK_FOR_IMPERSONATION,
|
||||
REQUEST_TYPE_TO_BLOCK_FOR_IMPERSONATION,
|
||||
} from '../../common/Constants';
|
||||
@@ -97,7 +101,7 @@ export enum ApiKeys {
|
||||
GENERATE_DYNAMIC_DOCUMENT = 'GENERATE_DYNAMIC_DOCUMENT',
|
||||
DOWNLOAD_LATEST_APP = 'DOWNLOAD_LATEST_APP',
|
||||
GET_SIGNED_URL_V2 = 'GET_SIGNED_URL_V2',
|
||||
GET_SIGNED_URL_FOR_REPORTEE_V2 = 'GET_SIGNED_URL_FOR_REPORTEE_V2'
|
||||
GET_SIGNED_URL_FOR_REPORTEE_V2 = 'GET_SIGNED_URL_FOR_REPORTEE_V2',
|
||||
}
|
||||
|
||||
export const API_URLS: Record<ApiKeys, string> = {} as Record<ApiKeys, string>;
|
||||
@@ -317,6 +321,10 @@ axiosInstance.interceptors.response.use(
|
||||
const end = Date.now();
|
||||
const milliseconds = end - Number(start);
|
||||
sendApiToClickstreamEvent(response, milliseconds, false);
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_API_FAILED, {
|
||||
statusCode: response?.status,
|
||||
url: response?.config?.url,
|
||||
});
|
||||
const donotHandleErrorOnStatusCode = (config.headers.donotHandleErrorOnStatusCode || []).map(
|
||||
Number
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user