users: cannot update profile fields of external user
This commit is contained in:
@@ -2273,17 +2273,26 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.updateUser = function (user, callback) {
|
||||
var data = {
|
||||
email: user.email,
|
||||
displayName: user.displayName,
|
||||
fallbackEmail: user.fallbackEmail,
|
||||
active: user.active,
|
||||
role: user.role
|
||||
};
|
||||
if (user.username) data.username = user.username;
|
||||
Client.prototype.updateUserProfile = function (userId, data, callback) {
|
||||
post('/api/v1/users/' + userId + '/profile', data, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 204) return callback(new ClientError(status, data));
|
||||
|
||||
post('/api/v1/users/' + user.id, data, null, function (error, data, status) {
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.setRole = function (userId, role, callback) {
|
||||
put('/api/v1/users/' + userId + '/role', { role: role }, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 204) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.setActive = function (userId, active, callback) {
|
||||
put('/api/v1/users/' + userId + '/active', { active: active }, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 204) return callback(new ClientError(status, data));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user