1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-10 21:24:20 +01:00
fab-manager/app/assets/javascripts/controllers/admin/abuses.js

24 lines
724 B
JavaScript
Raw Normal View History

2019-05-09 18:27:19 +02:00
/**
* Controller used in abuses management page
*/
Application.Controllers.controller('AbusesController', ['$scope', '$state', 'Abuse', 'abusesPromise', 'growl', '_t',
function ($scope, $state, Abuse, abusesPromise, growl, _t) {
2019-05-21 11:49:50 +02:00
/* PUBLIC SCOPE */
2019-05-09 18:27:19 +02:00
// List of all reported abuses
2019-05-21 11:49:50 +02:00
$scope.abuses = [];
/* PRIVATE SCOPE */
/**
* Kind of constructor: these actions will be realized first when the controller is loaded
*/
const initialize = function () {
// we display only abuses related to projects
$scope.abuses = abusesPromise.abuses.filter(a => a.signaled_type === 'Project');
};
// !!! MUST BE CALLED AT THE END of the controller
return initialize();
2019-05-09 18:27:19 +02:00
}
]);