Fix the user invitation to use userId

This commit is contained in:
Johannes Zellner
2016-04-03 01:05:36 +02:00
parent 8cbf83058f
commit 1b7406784e
2 changed files with 3 additions and 3 deletions

View File

@@ -471,8 +471,8 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
};
};
Client.prototype.sendInvite = function (username, callback) {
$http.post(client.apiOrigin + '/api/v1/users/' + username + '/invite', {}).success(function (data, status) {
Client.prototype.sendInvite = function (user, callback) {
$http.post(client.apiOrigin + '/api/v1/users/' + user.id + '/invite', {}).success(function (data, status) {
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data.resetToken);
}).error(defaultErrorHandler(callback));

View File

@@ -161,7 +161,7 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$scope.inviteSent.email = user.email;
$scope.inviteSent.setupLink = '';
Client.sendInvite(user.username, function (error, resetToken) {
Client.sendInvite(user, function (error, resetToken) {
if (error) return console.error(error);
// Client.notify('', 'Invitation was successfully sent to ' + user.email + '.', false, 'success');