INFRA-3664 : Change endpoint for fetching incident participants data

This commit is contained in:
Vijay Joshi
2024-08-29 11:25:46 +05:30
parent 86fb1fe14c
commit 4c581f5bb3
2 changed files with 4 additions and 4 deletions

View File

@@ -20,7 +20,7 @@ export const FETCH_INCIDENT_DATA = (payload: any): string => {
};
export const FETCH_PARTICIPANTS_DATA = (payload: string): string => {
return `${URL_PREFIX}/users?channel_id=${payload}`;
return `${URL_PREFIX}/incident-user?incident_id==${payload}`;
};
export const FETCH_HEADER_DETAILS = `${URL_PREFIX}/incidents/header`;

View File

@@ -51,7 +51,7 @@ const useIncidentApis = (): useIncidentApiProps => {
.then(response => {
dispatch(setIncidentData(response?.data?.data));
fetchIncidentLog(incidentId);
fetchParticipants(response?.data?.data?.slackChannel);
fetchParticipants(response?.data?.data?.id);
})
.catch(handleApiError);
};
@@ -65,8 +65,8 @@ const useIncidentApis = (): useIncidentApiProps => {
.catch(handleApiError);
};
const fetchParticipants = (slackChannel: string): void => {
const endPoint = FETCH_PARTICIPANTS_DATA(slackChannel);
const fetchParticipants = (incidentId: string): void => {
const endPoint = FETCH_PARTICIPANTS_DATA(incidentId);
ApiService.get(endPoint)
.then(response => {
dispatch(setParticipantsData(response?.data?.data));