feat: deleteall

This commit is contained in:
cv
2021-05-20 14:12:23 +02:00
parent 471fb1c698
commit fa98e2ad92
6 changed files with 83 additions and 4 deletions
+17
View File
@@ -295,3 +295,20 @@ exports.eventsDelete = async (req, res) => {
res.status(400).send(error);
}
};
// Create controller for DELETE request to '/events/:eventId'
// Returns -
exports.eventsDeleteAll = async (req, res) => {
try {
// set with nothing
db.set('events', []).write();
// update timer object
_updateTimersSingle();
res.sendStatus(201);
} catch (error) {
console.log('debug:', error);
res.status(400).send(error);
}
};