summaryrefslogtreecommitdiffstats
path: root/server/api/clients.js
diff options
context:
space:
mode:
authorUdo Walter2018-08-02 02:45:41 +0200
committerUdo Walter2018-08-02 02:45:41 +0200
commita65c45e5962b6cddf2f6dbf2cb7366b389418b19 (patch)
tree362f131bcc91dd9ef79227bf2603fd9eeded3d75 /server/api/clients.js
parent[groups] add create functionality (diff)
downloadbas-a65c45e5962b6cddf2f6dbf2cb7366b389418b19.tar.gz
bas-a65c45e5962b6cddf2f6dbf2cb7366b389418b19.tar.xz
bas-a65c45e5962b6cddf2f6dbf2cb7366b389418b19.zip
[groups] add ability to show all groups and clients
Diffstat (limited to 'server/api/clients.js')
-rw-r--r--server/api/clients.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/api/clients.js b/server/api/clients.js
index 1f28c0b..2780bd6 100644
--- a/server/api/clients.js
+++ b/server/api/clients.js
@@ -10,6 +10,13 @@ module.exports.get = {
})
},
+ // get all groups
+ getAll: function (req, res) {
+ db.client.findAll().then(list => {
+ res.send(list)
+ })
+ },
+
// get all clients that have no groups
getTopLevel: function (req, res) {
db.client.findAll({ where: { '$groups.id$': null }, include: ['groups'] }).then(clients => {