Allow setting email to nothing.
Previously, once an email is added to an account, it was not possible to remove it. Now an empty email address is accepted.
This commit is contained in:
parent
27ca92f2fd
commit
252de39ac0
@ -135,20 +135,15 @@ function ($scope, $interval, UserService) {
|
|||||||
$scope.changeEmail = function(newEmailFormData) {
|
$scope.changeEmail = function(newEmailFormData) {
|
||||||
$scope.emailFormData.isSaving = true;
|
$scope.emailFormData.isSaving = true;
|
||||||
|
|
||||||
if (newEmailFormData.newEmail === '') {
|
UserService.changeEmail(newEmailFormData.newEmail)
|
||||||
newEmailFormData.setAlert('Email cannot be blank.');
|
.success(function(data) {
|
||||||
newEmailFormData.isSaving = false;
|
$scope.alerts.showAlerts(data.alerts);
|
||||||
} else {
|
$scope.updateUsers(data.data);
|
||||||
UserService.changeEmail(newEmailFormData.newEmail)
|
$scope.loadCurrentUser();
|
||||||
.success(function(data) {
|
|
||||||
$scope.alerts.showAlerts(data.alerts);
|
|
||||||
$scope.updateUsers(data.data);
|
|
||||||
$scope.loadCurrentUser();
|
|
||||||
|
|
||||||
newEmailFormData.isSaving = false;
|
newEmailFormData.isSaving = false;
|
||||||
newEmailFormData.newUsername = '';
|
newEmailFormData.newUsername = '';
|
||||||
});
|
});
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.updatingDefaultBoard = false;
|
$scope.updatingDefaultBoard = false;
|
||||||
|
Reference in New Issue
Block a user