Make Practice Summary Report stub

This commit is contained in:
Senad Uka
2019-06-19 11:23:58 +02:00
parent 9a8d95dd19
commit 3ec13983c6
20 changed files with 629 additions and 88 deletions

View File

@@ -33,7 +33,29 @@ 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);
})
.catch((error) => {
console.log(error);
res.send([]);
});
};
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);
})
@@ -57,4 +79,5 @@ module.exports = {
getAllIncidents,
getUnscheduledIncidents,
getUnlockedIncidents,
getMemberIncidents,
};