Add door lock charges screen #12

Merged
bilal.catic merged 8 commits from add-door-lock-charges-screen into master 2019-06-19 00:26:07 +02:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 1371ab0580 - Show all commits

View File

@@ -108,7 +108,7 @@ const mapStateToProps = (state) => ({
});
const mapDispatchToProps = (dispatch) => ({
fetchIncidents: () => fetchIncidents(dispatch),
fetchIncidents: (dateRange) => fetchIncidents(dispatch, dateRange),
});
export default connect(mapStateToProps, mapDispatchToProps)(IncidentsReport);

View File

@@ -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});
})