Added empty email address for root users. everything should be functional from here on out.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-02-28 15:46:59 -07:00
parent 9091b3d2a8
commit 522fd2a9f5
5 changed files with 134 additions and 1 deletions

View File

@@ -350,4 +350,63 @@ function copyContributors(sourceVehicleId, destVehicleId) {
$("#workAroundInput").hide();
}
});
}
function showAccountInformationModal() {
$.get('/Home/GetUserAccountInformationModal', function (data) {
$('#accountInformationModalContent').html(data);
$('#accountInformationModal').modal('show');
})
}
function hideAccountInformationModal() {
$('#accountInformationModal').modal('hide');
}
function validateAndSaveUserAccount() {
var hasError = false;
if ($('#inputUsername').val().trim() == '') {
$('#inputUsername').addClass("is-invalid");
hasError = true;
} else {
$('#inputUsername').removeClass("is-invalid");
}
if ($('#inputEmail').val().trim() == '') {
$('#inputEmail').addClass("is-invalid");
hasError = true;
} else {
$('#inputEmail').removeClass("is-invalid");
}
if ($('#inputToken').val().trim() == '') {
$('#inputToken').addClass("is-invalid");
hasError = true;
} else {
$('#inputToken').removeClass("is-invalid");
}
if (hasError) {
errorToast("Please check the form data");
return;
}
var userAccountInfo = {
userName: $('#inputUsername').val(),
password: $('#inputPassword').val(),
emailAddress: $('#inputEmail').val(),
token: $('#inputToken').val()
}
$.post('/Home/UpdateUserAccount', { userAccount: userAccountInfo }, function (data) {
if (data.success) {
//hide modal
hideAccountInformationModal();
successToast('Profile Updated')
} else {
errorToast(data.message);
}
});
}
function generateTokenForUser() {
$.post('/Home/GenerateTokenForUser', function (data) {
if (data) {
successToast('Token sent');
} else {
errorToast(genericErrorMessage())
}
});
}