admin: display file dependancies and be able to remove them

This commit is contained in:
nemunaire 2019-07-21 23:46:23 +02:00
parent c8ece39cb2
commit 8131fda0e7
5 changed files with 93 additions and 3 deletions

View file

@ -1335,6 +1335,18 @@ angular.module("FICApp")
$rootScope.staticFilesNeedUpdate++;
return false;
}
$scope.deleteFileDep = function() {
$http({
url: "/api//files/" + this.file.id + "/dependancies/" + this.dep.id,
method: "DELETE"
}).then(function(response) {
$scope.files = ExerciceFile.query({ exerciceId: $routeParams.exerciceId });
}, function(response) {
$rootScope.newBox('danger', 'An error occurs when removing file dep:', response.data.errmsg);
});
$rootScope.staticFilesNeedUpdate++;
return false;
}
$scope.saveFile = function() {
this.file.$update();
$rootScope.staticFilesNeedUpdate++;