admin: fix bad location change after exercice deletion
authorPierre-Olivier Mercier <nemunaire@nemunai.re>
Sun, 9 Dec 2018 23:29:02 +0000 (00:29 +0100)
committerPierre-Olivier Mercier <nemunaire@nemunai.re>
Sun, 9 Dec 2018 23:31:30 +0000 (00:31 +0100)
admin/static/js/app.js

index 29ead55..d4099fd 100644 (file)
@@ -1094,9 +1094,10 @@ angular.module("FICApp")
        };
 
        $scope.deleteExercice = function() {
+           var tid = $scope.exercice.id_theme;
            this.exercice.$remove(function() {
                $rootScope.staticFilesNeedUpdate++;
-               $location.url("/themes/" + $routeParams.themeId);
+               $location.url("/themes/" + tid);
            }, function(response) {
                    $rootScope.newBox('danger', 'An error occurs when trying to delete exercice:', response.data.errmsg);
                });