fix fetching incidents for specific date in backend

This commit is contained in:
Bilal Catic
2019-06-18 10:32:17 +02:00
parent 1371ab0580
commit 16a62b35de
4 changed files with 54 additions and 9 deletions

View File

@@ -33,7 +33,12 @@ const addNewMapping = (req, res) => {
};
const getAllIncidents = (req, res) => {
getAllDoorLockIncidents()
const dateRange = {
startDate: req.params.startDate,
endDate: req.params.endDate,
};
getAllDoorLockIncidents(dateRange)
.then((incidents) => {
res.send(incidents);
})