From f6cadb25e42e6568098f2962fa9b302cfbf074c5 Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Sun, 29 Jul 2018 23:31:08 +0000 Subject: [server/router] changed api routing from query keyword to url parameter for group and client api (todo: the rest) --- server/api/clients.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'server/api/clients.js') diff --git a/server/api/clients.js b/server/api/clients.js index aeb4673..37e207b 100644 --- a/server/api/clients.js +++ b/server/api/clients.js @@ -3,18 +3,16 @@ var path = require('path') var db = require(path.join(__appdir, 'lib', 'sequelize')) module.exports = { - get: function (req, res) { - switch (req.query.action) { - case 'getInfo': - db.client.findOne({ where: { id: req.query.id }}).then(client => { - res.send(client) - }) - break - default: - res.end() + get: { + + getInfo: function (req, res) { + db.client.findOne({ where: { id: req.query.id } }).then(client => { + res.send(client) + }) } + }, - post: function (req, res) { + post: { } } -- cgit v1.2.3-55-g7522