feat: reload on change

This commit is contained in:
cv
2021-04-24 23:24:36 +02:00
parent 01eec95637
commit 65ffd09410
4 changed files with 78 additions and 10 deletions
+6
View File
@@ -39,6 +39,7 @@ function getEventEvents() {
.value();
}
// Updates timer object
function _updateTimers() {
const results = getEventEvents();
global.timer.updateEventList(results);
@@ -181,6 +182,11 @@ exports.eventsDelete = async (req, res) => {
const c = _getEventsCount();
const e = db.get('events').find({ id: req.params.eventId }).value();
if (e == null) {
res.status(400).send(`No match`);
return;
}
if (c > 0 && e.order < c) incrementFrom(e.order, -1);
// add new event