Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Findeton committed Jun 22, 2024
1 parent 454530a commit 3f371dc
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions avAdmin/admin-directives/create/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -1327,16 +1327,15 @@ angular.module('avAdmin')

scope.openPreview = function()
{
var electionId = 123456789;
if (scope.elections.lengh === 1) {
electionId = scope.elections[0].id || electionId;
} else {
var foundElection = scope.elections.find(function (element) { return true === element.virtual; });
electionId = foundElection && foundElection.id || electionId;
}
sessionStorage.setItem(electionId, JSON.stringify(scope.elections));
var url = window.location.origin +"/booth/" + electionId + "/preview-vote";
window.open(url, '_blank');
Authmethod.createLivePreview(JSON.stringify(scope.elections))
.then(
function onSuccess(response) {
var electionId = response.data.id;
var url = window.location.origin +"/booth/" + electionId + "/uuid-preview-vote";
window.open(url, '_blank');
},
deferred.reject
);
return true;
};

Expand Down

0 comments on commit 3f371dc

Please sign in to comment.