summaryrefslogtreecommitdiffstats
path: root/server/api/clients.js
diff options
context:
space:
mode:
authorUdo Walter2018-07-31 04:20:37 +0200
committerUdo Walter2018-07-31 04:20:37 +0200
commitcb7711cc9f76fe4211538bad74de68c57cd07e83 (patch)
tree633568bcbc8737e97eb0e99eaefbf846422e6147 /server/api/clients.js
parent[webapp/external-backends] Dialog polishing. Thx Udo for fixing the scroll co... (diff)
downloadbas-cb7711cc9f76fe4211538bad74de68c57cd07e83.tar.gz
bas-cb7711cc9f76fe4211538bad74de68c57cd07e83.tar.xz
bas-cb7711cc9f76fe4211538bad74de68c57cd07e83.zip
[groups] add edit form for groups; add description to groups and clients
Diffstat (limited to 'server/api/clients.js')
-rw-r--r--server/api/clients.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/server/api/clients.js b/server/api/clients.js
index 37e207b..d494fd0 100644
--- a/server/api/clients.js
+++ b/server/api/clients.js
@@ -2,17 +2,19 @@
var path = require('path')
var db = require(path.join(__appdir, 'lib', 'sequelize'))
-module.exports = {
- get: {
-
- getInfo: function (req, res) {
- db.client.findOne({ where: { id: req.query.id } }).then(client => {
- res.send(client)
- })
- }
-
+// GET Requests
+module.exports.get = {
+ getList: function (req, res) {
+ db.client.findAll({ attributes: ['id', 'name'] }).then(list => {
+ res.send(list)
+ })
},
- post: {
+ getGroups: function (req, res) {
+ db.client.findOne({ where: { id: req.query.id } }).then(client => {
+ client.getGroups().then(groups => {
+ res.send(groups)
+ })
+ })
}
}