diff --git a/qa/static/js/qa.js b/qa/static/js/qa.js index 82432542..d5e658fe 100644 --- a/qa/static/js/qa.js +++ b/qa/static/js/qa.js @@ -395,6 +395,22 @@ angular.module("FICApp") }) } + $scope.thumbUp = function(qid) { + $http({ + url: "api/qa/" + $routeParams.exerciceId + "/" + $scope.queries[qid].id + "/comments", + method: "POST", + data: { "content": "+1" }, + }).then(function(response) { + $http({ + url: "api/qa/" + $routeParams.exerciceId + "/" + $scope.queries[$scope.query_selected].id + "/comments" + }).then(function(response) { + $scope.queries_comments = response.data + }) + }, function(response) { + $scope.addToast('danger', 'An error occurs when trying to respond to QA entry:', response.data.errmsg); + }) + } + $scope.updateQA = function(qid) { $scope.newQuery = $scope.queries[$scope.query_selected] } diff --git a/qa/static/views/exercice.html b/qa/static/views/exercice.html index 7152b459..87e488af 100644 --- a/qa/static/views/exercice.html +++ b/qa/static/views/exercice.html @@ -38,11 +38,15 @@ {{ field }} + + + +