parent
16f16e8a15
commit
10efa96009
12 changed files with 94 additions and 23 deletions
|
@ -34,6 +34,23 @@ angular.module('quay').directive('billingOptions', function () {
|
|||
return difference < (60 * 60 * 24 * 60 * 1000 /* 60 days */);
|
||||
};
|
||||
|
||||
$scope.changeInvoiceEmailAddress = function() {
|
||||
bootbox.prompt('Enter the email address for receiving receipts', function(email) {
|
||||
// Copied from Angular.
|
||||
var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*$/i;
|
||||
if (!email || !EMAIL_REGEXP.test(email)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.obj['invoice_email_address'] = email;
|
||||
|
||||
var errorHandler = ApiService.errorDisplay('Could not change user details');
|
||||
ApiService.changeDetails($scope.organization, $scope.obj).then(function(resp) {
|
||||
$scope.working = false;
|
||||
}, errorHandler);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.changeCard = function() {
|
||||
var previousCard = $scope.currentCard;
|
||||
$scope.changingCard = true;
|
||||
|
|
Reference in a new issue