Fix strange behaviour with QCM/QCU

This commit is contained in:
nemunaire 2020-11-20 16:41:06 +01:00
parent 5a64611fde
commit 12f956f8d6
2 changed files with 4 additions and 4 deletions

View file

@ -80,7 +80,7 @@ angular.module("AtsebaytApp")
})
})
.factory("QuestProposal", function($resource) {
return $resource("/api/surveys/:surveyId/questions/:questId/proposals", { surveyId: '@id', questId: '@id' }, {
return $resource("/api/surveys/:surveyId/questions/:questId/proposals/:proposalId", { surveyId: '@id', questId: '@id', proposalId: '@id' }, {
'update': {method: 'PUT'},
})
})
@ -612,7 +612,7 @@ angular.module("AtsebaytApp")
$scope.saveProposal = function() {
if (this.proposal.id) {
this.proposal.$update({ surveyId: $scope.survey.id, questId: $scope.question.id });
this.proposal.$update({ surveyId: $scope.survey.id, questId: $scope.question.id, proposalId: this.proposal.id });
} else {
this.proposal.$save({ surveyId: $scope.survey.id, questId: $scope.question.id });
}