close election when tokens are added

pull/73/head
Pierre-Louis Guhur 4 years ago committed by guhur
parent af79b633dd
commit b8abc01cdb

@ -561,7 +561,7 @@ class CreateElection extends Component {
<div>
<small className="text-muted">
{t(
"List voters' emails in case the election is not opened",
"If you list voters' emails, only them will be able to access the election",
)}
</small>
</div>

@ -132,6 +132,7 @@ class Vote extends Component {
const { ratedCandidates } = this.state;
const electionSlug = this.props.match.params.slug;
const token = this.props.location.search.substr(7);
const endpoint = resolve(
this.context.urlServer,
this.context.routesServer.voteElection
@ -153,7 +154,8 @@ class Vote extends Component {
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
election: electionSlug,
grades_by_candidate: gradesByCandidate
grades_by_candidate: gradesByCandidate,
token: token,
})
})
.then(this.handleErrors)

Loading…
Cancel
Save