diff --git a/qa/static/js/qa.js b/qa/static/js/qa.js index bfc98a70..82432542 100644 --- a/qa/static/js/qa.js +++ b/qa/static/js/qa.js @@ -88,45 +88,45 @@ angular.module("FICApp") angular.module("FICApp") .factory("Version", function($resource) { - return $resource("/api/version") + return $resource("api/version") }) .factory("Todo", function($resource) { - return $resource("/api/qa_work.json") + return $resource("api/qa_work.json") }) .factory("TodoWorked", function($resource) { - return $resource("/api/qa_mywork.json") + return $resource("api/qa_mywork.json") }) .factory("Team", function($resource) { - return $resource("/api/teams/:teamId", { teamId: '@id' }, { + return $resource("api/teams/:teamId", { teamId: '@id' }, { 'update': {method: 'PUT'}, }) }) .factory("Teams", function($resource) { - return $resource("/api/teams.json") + return $resource("api/teams.json") }) .factory("Theme", function($resource) { - return $resource("/api/themes/:themeId", { themeId: '@id' }, { + return $resource("api/themes/:themeId", { themeId: '@id' }, { update: {method: 'PUT'} }); }) .factory("Themes", function($resource) { - return $resource("/api/themes.json", null, { + return $resource("api/themes.json", null, { 'get': {method: 'GET'}, }) }) .factory("ThemedExercice", function($resource) { - return $resource("/api/themes/:themeId/exercices/:exerciceId", { themeId: '@id', exerciceId: '@idExercice' }, { + return $resource("api/themes/:themeId/exercices/:exerciceId", { themeId: '@id', exerciceId: '@idExercice' }, { update: {method: 'PUT'} }) }) .factory("Exercice", function($resource) { - return $resource("/api/exercices/:exerciceId", { exerciceId: '@id' }, { + return $resource("api/exercices/:exerciceId", { exerciceId: '@id' }, { update: {method: 'PUT'}, patch: {method: 'PATCH'} }) }) .factory("ExerciceQA", function($resource) { - return $resource("/api/qa/:exerciceId/:qaId", { exerciceId: '@idExercice', qaId: '@id' }, { + return $resource("api/qa/:exerciceId/:qaId", { exerciceId: '@idExercice', qaId: '@id' }, { update: {method: 'PUT'}, patch: {method: 'PATCH'} }) @@ -267,7 +267,7 @@ angular.module("FICApp") .controller("AllExercicesListController", function($scope, Exercice, Theme, $routeParams, $location, $rootScope, $http, $filter) { $http({ - url: "/api/themes.json", + url: "api/themes.json", method: "GET" }).then(function(response) { $scope.themes = response.data @@ -320,7 +320,7 @@ angular.module("FICApp") $scope.exercice = Exercice.get({ exerciceId: $routeParams.exerciceId }); } $http({ - url: "/api/themes.json", + url: "api/themes.json", method: "GET" }).then(function(response) { $scope.themes = response.data @@ -370,7 +370,7 @@ angular.module("FICApp") } else { $scope.query_selected = qid $http({ - url: "/api/qa/" + $routeParams.exerciceId + "/" + $scope.queries[$scope.query_selected].id + "/comments" + url: "api/qa/" + $routeParams.exerciceId + "/" + $scope.queries[$scope.query_selected].id + "/comments" }).then(function(response) { $scope.queries_comments = response.data }) @@ -380,13 +380,13 @@ angular.module("FICApp") $scope.newComment = {content: ""} $scope.addComment = function() { $http({ - url: "/api/qa/" + $routeParams.exerciceId + "/" + $scope.queries[$scope.query_selected].id + "/comments", + url: "api/qa/" + $routeParams.exerciceId + "/" + $scope.queries[$scope.query_selected].id + "/comments", method: "POST", data: $scope.newComment, }).then(function(response) { $scope.newComment = {content: ""} $http({ - url: "/api/qa/" + $routeParams.exerciceId + "/" + $scope.queries[$scope.query_selected].id + "/comments" + url: "api/qa/" + $routeParams.exerciceId + "/" + $scope.queries[$scope.query_selected].id + "/comments" }).then(function(response) { $scope.queries_comments = response.data })