diff --git a/client/src/scenes/IncidentsReport/index.js b/client/src/scenes/IncidentsReport/index.js index d12cd01..4317159 100644 --- a/client/src/scenes/IncidentsReport/index.js +++ b/client/src/scenes/IncidentsReport/index.js @@ -108,7 +108,7 @@ const mapStateToProps = (state) => ({ }); const mapDispatchToProps = (dispatch) => ({ - fetchIncidents: () => fetchIncidents(dispatch), + fetchIncidents: (dateRange) => fetchIncidents(dispatch, dateRange), }); export default connect(mapStateToProps, mapDispatchToProps)(IncidentsReport); diff --git a/client/src/store/actions/integrationActions.js b/client/src/store/actions/integrationActions.js index 395186f..b79c15e 100644 --- a/client/src/store/actions/integrationActions.js +++ b/client/src/store/actions/integrationActions.js @@ -37,10 +37,10 @@ export const addNewMapping = (dispatch, mapping) => { }; export const fetchIncidents = (dispatch, dateRange) => { + const { startDate, endDate } = dateRange; + dispatch({type: FETCH_INCIDENTS_PENDING}); - API.get('integration/report/allIncidents', { - dateRange - }) + API.get(`integration/report/allIncidents/${startDate}/${endDate}`) .then(response => { dispatch({type: FETCH_INCIDENTS_SUCCESS, payload: response.data}); })