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> <div>
<small className="text-muted"> <small className="text-muted">
{t( {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> </small>
</div> </div>

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

Loading…
Cancel
Save