Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Findeton committed Nov 7, 2024
1 parent e9fe038 commit 88e3fd7
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions avAdmin/admin-directives/elections/elections.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,18 @@ angular.module('avAdmin')
scope.loadMoreElections(true);
}

function getElectionIds() {
return Object.entries(scope.selectedElections)
.filter(function (input) {
// input = [k, v]
return input[1];
})
.map(function (input) {
// input = [k, v]
return input[0];
})
}

function deleteSelected() {
// show the initial edit dialog
$modal.open({
Expand All @@ -191,9 +203,7 @@ angular.module('avAdmin')
size: 'lg',
resolve: {
electionIds: function () {
return Object.entries(scope.selectedElections)
.filter(([k, v]) => v)
.map(([k,v]) => k)
return getElectionIds()
.join(", ");
}
}
Expand All @@ -202,9 +212,7 @@ angular.module('avAdmin')
// again unless necessary (setting the skip edit dialog to true) and
// continue to the confirmation dialog
}).result.then(function () {
var electionIds = Object.entries(scope.selectedElections)
.filter(([k, v]) => v)
.map(([k,v]) => k);
var electionIds = getElectionIds();
doDeleteElections(electionIds);
});
}
Expand Down

0 comments on commit 88e3fd7

Please sign in to comment.