stop inserting and changing deleted unlock incidents
This commit is contained in:
@@ -46,6 +46,14 @@ router.get('/integration/report/practiceSummary/:year', getPracticeSummaryReport
|
|||||||
|
|
||||||
|
|
||||||
// temporary route, manually trigger door lock charge calculations
|
// temporary route, manually trigger door lock charge calculations
|
||||||
router.get('/calculate', (req, res) => { calculateDoorLockCharges().then(() => res.send('Done')).catch((err) => res.send('Error \r\n', err));});
|
router.get('/calculate', (req, res) => {
|
||||||
|
calculateDoorLockCharges()
|
||||||
|
.then(() => {
|
||||||
|
res.send('Done');
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
res.send(`Error \r\n ${err}`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ const insertUnlockedIncidents = (incidents) => {
|
|||||||
bookingStart: start,
|
bookingStart: start,
|
||||||
bookingEnd: end,
|
bookingEnd: end,
|
||||||
unlockTimestamp,
|
unlockTimestamp,
|
||||||
incidentLevel,
|
|
||||||
},
|
},
|
||||||
defaults: {...incidentForDB},
|
defaults: {...incidentForDB},
|
||||||
}));
|
}));
|
||||||
@@ -198,7 +197,7 @@ const setUnlockedIncidentsLevel = (incidents) => {
|
|||||||
const incidentsWithLevel = [];
|
const incidentsWithLevel = [];
|
||||||
|
|
||||||
incidents.forEach((incident) => {
|
incidents.forEach((incident) => {
|
||||||
const memberLastIncident = membersLastIncident[incident.memberId];
|
const memberLastIncident = Object.assign({}, membersLastIncident[incident.memberId]);
|
||||||
|
|
||||||
const formattedIncident = {
|
const formattedIncident = {
|
||||||
reservation: incident.reservation,
|
reservation: incident.reservation,
|
||||||
|
|||||||
Reference in New Issue
Block a user