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.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/server/api/clients.js b/server/api/clients.js
index d494fd0..8daab55 100644
--- a/server/api/clients.js
+++ b/server/api/clients.js
@@ -10,11 +10,17 @@ module.exports.get = {
})
},
- getGroups: function (req, res) {
- db.client.findOne({ where: { id: req.query.id } }).then(client => {
- client.getGroups().then(groups => {
- res.send(groups)
- })
+ // get all clients that have no groups
+ getTopLevel: function (req, res) {
+ db.client.findAll({ where: { '$groups.id$': null }, include: ['groups'] }).then(clients => {
+ res.send(clients)
+ })
+ },
+
+ // get name, description, ip, mac and uuid of a client (by id)
+ getClient: function (req, res) {
+ db.client.findOne({ where: { id: req.query.id }, include: ['groups'] }).then(client => {
+ res.send(client)
})
}
}