addUser now returns an id
This commit is contained in:
+2
-2
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
+4
-4
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user