Use a copy of the mailinglist properties on edit
This commit is contained in:
@@ -105,10 +105,12 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
edit: {
|
||||
busy: false,
|
||||
error: null,
|
||||
list: null,
|
||||
name: '',
|
||||
members: [],
|
||||
|
||||
show: function (list) {
|
||||
$scope.mailinglists.edit.list = list;
|
||||
$scope.mailinglists.edit.name = list.name;
|
||||
$scope.mailinglists.edit.members = list.members.map(function (name) { return $scope.mailboxes.mailboxes.find(function (m) { return m.name === name; })});
|
||||
|
||||
$('#mailinglistEditModal').modal('show');
|
||||
},
|
||||
@@ -116,7 +118,9 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
submit: function () {
|
||||
$scope.mailinglists.edit.busy = true;
|
||||
|
||||
Client.updateMailingList($scope.selectedDomain.domain, $scope.mailinglists.edit.list.name, $scope.mailinglists.edit.list.members, function (error) {
|
||||
var members = $scope.mailinglists.edit.members.map(function (m) { return m.name; });
|
||||
|
||||
Client.updateMailingList($scope.selectedDomain.domain, $scope.mailinglists.edit.name, members, function (error) {
|
||||
$scope.mailinglists.edit.busy = false;
|
||||
|
||||
if (error) return console.error(error);
|
||||
|
||||
Reference in New Issue
Block a user