rename form name

This commit is contained in:
Girish Ramakrishnan
2022-03-30 09:18:20 -07:00
parent 68a0dc3855
commit 37f74c4ed0
2 changed files with 27 additions and 27 deletions

View File

@@ -340,8 +340,8 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$scope.useradd.role = 'user';
$scope.useradd.sendInvite = false;
$scope.useradd_form.$setUntouched();
$scope.useradd_form.$setPristine();
$scope.useraddForm.$setUntouched();
$scope.useraddForm.$setPristine();
$('#userAddModal').modal('show');
},
@@ -370,11 +370,11 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
if (error.statusCode === 409) {
if (error.message.toLowerCase().indexOf('email') !== -1) {
$scope.useradd.error.email = 'Email already taken';
$scope.useradd_form.email.$setPristine();
$scope.useraddForm.email.$setPristine();
$('#inputUserAddEmail').focus();
} else if (error.message.toLowerCase().indexOf('username') !== -1 || error.message.toLowerCase().indexOf('mailbox') !== -1) {
$scope.useradd.error.username = 'Username already taken';
$scope.useradd_form.username.$setPristine();
$scope.useraddForm.username.$setPristine();
$('#inputUserAddUsername').focus();
} else {
// should not happen!!
@@ -385,11 +385,11 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
if (error.message.toLowerCase().indexOf('email') !== -1) {
$scope.useradd.error.email = 'Invalid Email';
$scope.useradd.error.emailAttempted = $scope.useradd.email;
$scope.useradd_form.email.$setPristine();
$scope.useraddForm.email.$setPristine();
$('#inputUserAddEmail').focus();
} else if (error.message.toLowerCase().indexOf('username') !== -1) {
$scope.useradd.error.username = error.message;
$scope.useradd_form.username.$setPristine();
$scope.useraddForm.username.$setPristine();
$('#inputUserAddUsername').focus();
} else {
console.error('Unable to create user.', error.statusCode, error.message);