mirror of
https://github.com/VinylDNS/vinyldns
synced 2025-08-29 13:27:43 +00:00
Resolve group edit details update
This commit is contained in:
parent
9e0a38d3b3
commit
63050e90bc
@ -231,18 +231,10 @@ angular.module('controller.groups', []).controller('GroupsController', function
|
||||
$("#modal_edit_group").modal("show");
|
||||
};
|
||||
|
||||
$scope.submitEditGroup = function (name, email, description) {
|
||||
//prevent user executing service call multiple times
|
||||
//if true prevent, if false allow for execution of rest of code
|
||||
//ng-href='/groups'
|
||||
$log.log('updateGroup::called', $scope.data);
|
||||
|
||||
if ($scope.processing) {
|
||||
$log.log('updateGroup::processing is true; exiting');
|
||||
return;
|
||||
}
|
||||
//flag to prevent multiple clicks until previous promise has resolved.
|
||||
$scope.processing = true;
|
||||
$scope.getGroupAndUpdate = function(groupId, name, email, description) {
|
||||
function success(response) {
|
||||
$log.debug('groupsService::getGroup-success');
|
||||
$scope.currentGroup = response.data;
|
||||
|
||||
//data from user form values
|
||||
var payload =
|
||||
@ -253,7 +245,6 @@ angular.module('controller.groups', []).controller('GroupsController', function
|
||||
'members': $scope.currentGroup.members,
|
||||
'admins': $scope.currentGroup.admins
|
||||
};
|
||||
|
||||
if (description) {
|
||||
payload['description'] = description;
|
||||
}
|
||||
@ -267,12 +258,33 @@ angular.module('controller.groups', []).controller('GroupsController', function
|
||||
$scope.refresh();
|
||||
return response.data;
|
||||
}
|
||||
|
||||
return groupsService.updateGroup($scope.currentGroup.id, payload)
|
||||
return groupsService.updateGroup(groupId, payload)
|
||||
.then(success)
|
||||
.catch(function (error) {
|
||||
handleError(error, 'groupsService::updateGroup-failure');
|
||||
});
|
||||
}
|
||||
|
||||
return groupsService
|
||||
.getGroup(groupId)
|
||||
.then(success)
|
||||
.catch(function (error) {
|
||||
handleError(error, 'groupsService::getGroup-failure');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.submitEditGroup = function (name, email, description) {
|
||||
//prevent user executing service call multiple times
|
||||
//if true prevent, if false allow for execution of rest of code
|
||||
//ng-href='/groups'
|
||||
if ($scope.processing) {
|
||||
$log.debug('updateGroup::processing is true; exiting');
|
||||
return;
|
||||
}
|
||||
|
||||
//flag to prevent multiple clicks until previous promise has resolved.
|
||||
$scope.processing = true;
|
||||
$scope.getGroupAndUpdate($scope.currentGroup.id, name, email, description);
|
||||
};
|
||||
|
||||
$scope.confirmDeleteGroup = function (groupInfo) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user