Commit 9200cc5f authored by Dennis Willers's avatar Dennis Willers 🏀

Change Table Name

parent b589c929
Pipeline #287 passed with stages
in 2 minutes and 7 seconds
......@@ -4,10 +4,11 @@ function createRouter(db) {
const router = express.Router();
// the routes are defined here
router.post('/addSpielSession', (req, res) => {
router.post('/addSession', (req, res) => {
var spielname = req.body.spielname;
if (spielname.match(/^[0-9a-zA-Z]+$/) != null) {
db.query(
'INSERT INTO Spielsession (SessionName) VALUES (\"'+spielname+'\");',
'INSERT INTO Session (SessionName) VALUES (\"'+spielname+'\");',
(error) => {
if (error) {
console.error(error);
......@@ -22,11 +23,11 @@ function createRouter(db) {
}
});
router.post('/isSpielSession', (req, res) => {
router.post('/isSession', (req, res) => {
var spielname = req.body.spielname;
if (spielname.match(/^[0-9a-zA-Z]+$/) != null) {
db.query(
'SELECT SessionName FROM Spielsession WHERE SessionName = \''+spielname+'\';',
'SELECT SessionName FROM Session WHERE SessionName = \''+spielname+'\';',
(error, results) => {
if (error) {
console.log(error);
......@@ -45,9 +46,9 @@ function createRouter(db) {
}
});
router.get('/SpielSession', function (req, res) {
router.get('/Session', function (req, res) {
db.query(
'SELECT * FROM Spielsession',
'SELECT * FROM Session',
(error, results) => {
if (error) {
console.log(error);
......
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