This commit is contained in:
cv
2021-04-20 12:16:43 +02:00
parent e566424738
commit 2f205bcb55
14 changed files with 291 additions and 194 deletions
+1 -8
View File
@@ -109,7 +109,6 @@ exports.eventsPost = async (req, res) => {
res.sendStatus(201);
} catch (error) {
res.status(400).send(error);
console.log('debug', error);
}
};
@@ -119,19 +118,14 @@ exports.eventsPut = async (req, res) => {
// no valid params
if (!req.body) {
res.status(400).send(`No object found`);
console.log('error here', 'noobj');
return;
}
let eventId = req.body.id;
if (!eventId) {
res.status(400).send(`No id found`);
console.log('error here', 'noid');
res.status(400).send(`Object malformed: id missing`);
return;
}
try {
db.get('events')
.find({ id: req.body.id })
@@ -141,7 +135,6 @@ exports.eventsPut = async (req, res) => {
.then(res.sendStatus(200));
} catch (error) {
res.status(400).send(error);
console.log('error here', error);
}
};
+14 -1
View File
@@ -1,3 +1,16 @@
{
"events": []
"events": [],
"event": {
"title": "",
"url": "",
"publicInfo": "",
"backStageInfo": ""
},
"settings": {
"app": "ontime",
"version": 1,
"osc_enabled": false,
"osc_port": 8008,
"lock": false
}
}
+2 -2
View File
@@ -1,8 +1,8 @@
const express = require('express');
const router = express.Router();
// import playback controller
const eventsController = require('../controllers/eventsController');
// import events controller
const eventsController = require('../controllers/eventsController');
// create route between controller and '/events' endpoint
router.get('/', eventsController.eventsGetAll);