Commit a4c704ee authored by Dennis Willers's avatar Dennis Willers 🏀

Add Postrequest: isSpielSession

parent 87d0b027
Pipeline #280 passed with stages
in 2 minutes and 5 seconds
...@@ -23,6 +23,24 @@ function createRouter(db) { ...@@ -23,6 +23,24 @@ function createRouter(db) {
} }
}); });
router.post('/isSpielSession', (req, res) => {
db.query(
'SELECT SessionName FROM Spielsession WHERE SessionName = \''+req.body.spielname+'\';',
(error, results) => {
if (error) {
console.log(error);
res.status(500).json({status: 'error'});
} else {
if (results.length > 0) {
res.status(200).json({status: 'true'});
} else {
res.status(200).json({status: 'false'});
}
}
}
);
});
router.get('/SpielSession', function (req, res) { router.get('/SpielSession', function (req, res) {
db.query( db.query(
'SELECT * FROM Spielsession', 'SELECT * FROM Spielsession',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment