Skip to content
Snippets Groups Projects
Commit f3892601 authored by Alexis POYEN's avatar Alexis POYEN
Browse files

Feat : update votes

parent 773b5dbf
No related branches found
No related tags found
1 merge request!42Resolve "Capture votes"
...@@ -223,8 +223,8 @@ class Vote { ...@@ -223,8 +223,8 @@ class Vote {
if (votes.length == 0) method = "POST"; if (votes.length == 0) method = "POST";
else method = "PUT"; else method = "PUT";
candidateLists.forEach((candidateList) => { candidateLists.forEach(async (candidateList) => {
voteHandler.VoteModel.saveVote( await voteHandler.VoteModel.saveVote(
method, method,
voteHandler.DeskRoundID, voteHandler.DeskRoundID,
candidateList.ID, candidateList.ID,
...@@ -236,7 +236,7 @@ class Vote { ...@@ -236,7 +236,7 @@ class Vote {
); );
}); });
this.VoteModel.saveVote( await this.VoteModel.saveVote(
method, method,
this.DeskRoundID, this.DeskRoundID,
null, null,
...@@ -244,7 +244,7 @@ class Vote { ...@@ -244,7 +244,7 @@ class Vote {
true, true,
false false
); );
this.VoteModel.saveVote( await this.VoteModel.saveVote(
method, method,
this.DeskRoundID, this.DeskRoundID,
null, null,
...@@ -252,5 +252,7 @@ class Vote { ...@@ -252,5 +252,7 @@ class Vote {
false, false,
true true
); );
await this.VoteModel.refreshVotes();
await this.loadVotes();
} }
} }
...@@ -71,7 +71,6 @@ class VoteModel { ...@@ -71,7 +71,6 @@ class VoteModel {
`Vote could not be updated or created (status ${response.status})` `Vote could not be updated or created (status ${response.status})`
); );
} }
this.refreshVotes();
return await response.json(); return await response.json();
} catch (e) { } catch (e) {
Messages.Show("is-warning", e.message); Messages.Show("is-warning", e.message);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment