summaryrefslogtreecommitdiffstats
path: root/server/api/clients.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/api/clients.js')
-rw-r--r--server/api/clients.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/server/api/clients.js b/server/api/clients.js
index f7fe455..aeb4673 100644
--- a/server/api/clients.js
+++ b/server/api/clients.js
@@ -4,15 +4,15 @@ var db = require(path.join(__appdir, 'lib', 'sequelize'))
module.exports = {
get: function (req, res) {
- // db.sequelize.authenticate()
- // .then(() => { console.log('Connection has been established successfully.'); })
- // .catch(err => { console.error('Unable to connect to the database:', err); });
-
- // db.users2.create({ username: "wasd", password: "wasd", email: "w@a.de", name: "wa"});
- db.users2.findOne({ where: { username: 'wasd' } }).then(user => {
- console.log(user.get('username'))
- })
- res.end()
+ switch (req.query.action) {
+ case 'getInfo':
+ db.client.findOne({ where: { id: req.query.id }}).then(client => {
+ res.send(client)
+ })
+ break
+ default:
+ res.end()
+ }
},
post: function (req, res) {