Fixed comment updating after voting on it

It reported bad score until user has refreshed the page.
This commit is contained in:
Marcin Kurczewski
2014-11-10 15:54:08 +01:00
parent 6f801f2628
commit 818a8a9054
9 changed files with 65 additions and 36 deletions

View File

@ -210,8 +210,8 @@ App.Presenters.PostCommentListPresenter = function(
function score(comment, scoreValue) {
promise.wait(api.post('/comments/' + comment.id + '/score', {score: scoreValue}))
.then(function(response) {
comment.score = response.json.score;
comment.ownScore = parseInt(response.json.score);
comment.score = parseInt(response.json.score);
comment.ownScore = parseInt(response.json.ownScore);
updateComment(comment);
}).fail(showGenericError);
}