From 19982b1815a45cfd883b8a65e05e01c24339078c Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Wed, 10 Feb 2016 14:25:08 +0100 Subject: [PATCH] Add Client.getGroups() --- webadmin/src/js/client.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webadmin/src/js/client.js b/webadmin/src/js/client.js index f4dadf3c0..1e54d6b59 100644 --- a/webadmin/src/js/client.js +++ b/webadmin/src/js/client.js @@ -392,6 +392,13 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification', }).error(defaultErrorHandler(callback)); }; + Client.prototype.getGroups = function (callback) { + $http.get(client.apiOrigin + '/api/v1/groups').success(function (data, status) { + if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data)); + callback(null, data.groups); + }).error(defaultErrorHandler(callback)); + }; + Client.prototype.getNonApprovedApps = function (callback) { if (!this._config.developerMode) return callback(null, []);