diff --git a/src/js/client.js b/src/js/client.js index de99eeab7..1d24596f3 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -1737,7 +1737,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout }); }; - Client.prototype.createUser = function (user, callback) { + Client.prototype.addUser = function (user, callback) { var data = { email: user.email, displayName: user.displayName, @@ -1750,7 +1750,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout if (error) return callback(error); if (status !== 201) return callback(new ClientError(status, data)); - callback(null, data); + callback(null, data.id); }); }; diff --git a/src/views/users.js b/src/views/users.js index 35583e917..8272a588f 100644 --- a/src/views/users.js +++ b/src/views/users.js @@ -166,7 +166,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio role: $scope.useradd.role }; - Client.createUser(user, function (error, newUserInfo) { + Client.addUser(user, function (error, userId) { if (error) { $scope.useradd.busy = false; @@ -207,9 +207,9 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio var NOOP = function (next) { next(); }; async.series([ - Client.setGroups.bind(Client, newUserInfo.id, groupIds), - $scope.useradd.sendInvite ? Client.createInvite.bind(Client, newUserInfo.id) : NOOP, - $scope.useradd.sendInvite ? Client.sendInvite.bind(Client, newUserInfo.id) : NOOP + Client.setGroups.bind(Client, userId, groupIds), + $scope.useradd.sendInvite ? Client.createInvite.bind(Client, userId) : NOOP, + $scope.useradd.sendInvite ? Client.sendInvite.bind(Client, userId) : NOOP ], function (error) { $scope.useradd.busy = false;