admin: add button to disable inactive teams

This commit is contained in:
nemunaire 2019-01-21 02:54:27 +01:00
parent 48fcfec0d0
commit 088c2402cd
4 changed files with 61 additions and 1 deletions

View file

@ -1427,10 +1427,17 @@ angular.module("FICApp")
}
})
.controller("TeamsListController", function($scope, Team, $location) {
.controller("TeamsListController", function($scope, $rootScope, Team, $location, $http) {
$scope.teams = Team.query();
$scope.fields = ["id", "name"];
$scope.desactiveTeams = function() {
$http.post("/api/disableinactiveteams").then(function() {
$scope.teams = Team.query();
}, function(response) {
$rootScope.newBox('danger', 'An error occurs when disabling inactive teams:', response.data.errmsg);
});
}
$scope.show = function(id) {
$location.url("/teams/" + id);
};