Show incident report (without filtering for now)

This commit is contained in:
Senad Uka
2019-06-17 13:24:34 +02:00
parent 393e9b8aec
commit 9a8d95dd19
27 changed files with 400 additions and 51 deletions

View File

@@ -1,6 +1,7 @@
'use strict';
const { getMappingsFromDatabase, fetchOffices, fetchResources, saveNewMappingToDatabase } = require('../services/officeRnD/resources');
const { getAllDoorLockIncidents } = require('../services/integration/reports');
const getKnownOfficeResourceMappings = (req, res) => {
const dataToFetch = [getMappingsFromDatabase(), fetchOffices(), fetchResources() ];
@@ -31,7 +32,29 @@ const addNewMapping = (req, res) => {
}
};
const getAllIncidents = (req, res) => {
getAllDoorLockIncidents()
.then((incidents) => {
res.send(incidents);
})
.catch((error) => {
console.log(error);
res.send([]);
});
};
const getUnlockedIncidents = (req, res) => {
};
const getUnscheduledIncidents = (req, res) => {
};
module.exports = {
getKnownOfficeResourceMappings,
addNewMapping,
getAllIncidents,
getUnscheduledIncidents,
getUnlockedIncidents,
};