Add ability to change an organization’s email address
This commit is contained in:
parent
f0add0e6cf
commit
cbf80281ba
7 changed files with 262 additions and 3 deletions
|
@ -1450,6 +1450,7 @@ function OrgAdminCtrl($rootScope, $scope, Restangular, $routeParams, UserService
|
|||
$scope.invoiceLoading = true;
|
||||
$scope.logsShown = 0;
|
||||
$scope.invoicesShown = 0;
|
||||
$scope.changingOrganization = false;
|
||||
|
||||
$scope.loadLogs = function() {
|
||||
$scope.logsShown++;
|
||||
|
@ -1463,6 +1464,28 @@ function OrgAdminCtrl($rootScope, $scope, Restangular, $routeParams, UserService
|
|||
$scope.hasPaidPlan = plan && plan.price > 0;
|
||||
};
|
||||
|
||||
$scope.changeEmail = function() {
|
||||
$scope.changingOrganization = true;
|
||||
var params = {
|
||||
'orgname': orgname
|
||||
};
|
||||
|
||||
var data = {
|
||||
'email': $scope.organizationEmail
|
||||
};
|
||||
|
||||
ApiService.changeOrganizationDetails(data, params).then(function(org) {
|
||||
$scope.changingOrganization = false;
|
||||
$scope.changeEmailForm.$setPristine();
|
||||
$scope.organization = org;
|
||||
}, function(resp) {
|
||||
$scope.changeEmailError = result.data.message;
|
||||
$timeout(function() {
|
||||
$('#changeEmailForm').popover('show');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.loadMembers = function() {
|
||||
if ($scope.membersFound) { return; }
|
||||
$scope.membersLoading = true;
|
||||
|
@ -1488,6 +1511,7 @@ function OrgAdminCtrl($rootScope, $scope, Restangular, $routeParams, UserService
|
|||
$scope.orgResource = ApiService.getOrganizationAsResource({'orgname': orgname}).get(function(org) {
|
||||
if (org && org.is_admin) {
|
||||
$scope.organization = org;
|
||||
$scope.organizationEmail = org.email;
|
||||
$rootScope.title = orgname + ' (Admin)';
|
||||
$rootScope.description = 'Administration page for organization ' + orgname;
|
||||
}
|
||||
|
|
Reference in a new issue