handle fetching members list and members incidents list

This commit is contained in:
Bilal Catic
2019-06-18 23:59:00 +02:00
parent 785e336e55
commit 0ccd2ff55c
4 changed files with 66 additions and 13 deletions

View File

@@ -48,6 +48,23 @@ const getAllIncidents = (req, res) => {
});
};
const getMemberIncidents = (req, res) => {
const memberId = req.params.memberId;
const dateRange = {
startDate: req.params.startDate,
endDate: req.params.endDate,
};
getAllDoorLockIncidents(dateRange, memberId)
.then((incidents) => {
res.send(incidents);
})
.catch((error) => {
console.log(error);
res.send([]);
});
};
const getUnlockedIncidents = (req, res) => {
};
@@ -62,4 +79,5 @@ module.exports = {
getAllIncidents,
getUnscheduledIncidents,
getUnlockedIncidents,
getMemberIncidents,
};