qa: new button to speed up +1

This commit is contained in:
nemunaire 2020-09-09 21:15:58 +02:00
commit 70afa61814
2 changed files with 20 additions and 0 deletions

View file

@ -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]
}