{"size": 977, "ext": "js", "max_stars_repo_path": "app/templates/dentists/dentists.ctrl.js", "max_stars_repo_name": "marielelyukh/admin-Mahsevon-Theara", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/templates/dentists/dentists.ctrl.js", "max_issues_repo_name": "marielelyukh/admin-Mahsevon-Theara", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/templates/dentists/dentists.ctrl.js", "max_forks_repo_name": "marielelyukh/admin-Mahsevon-Theara", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.53125, "max_line_length": 100, "alphanum_fraction": 0.4667349028}
;(function () {
    angular
        .module('app')
        .controller('DentistsCtrl', DentistsCtrl);

    /* @ngInject */
    function DentistsCtrl(modalSvc, dentistSvc, userSvc, toastr, dentists, amount_dentist, $state) {
        var vm = this;
        var user_ids = [];
        vm.deleteUser = deleteUser;
        vm.dentists = dentists;
        vm.amount_dentist = amount_dentist;

        function deleteUser(user){
            user_ids.push(user.id);
            var user_id = {
                ids: user_ids
            };
            modalSvc.confirmDelete().result.then(function(){
                userSvc.removeUser(user_id).then(function (data) {
                    if(data.success){
                        $state.reload();
                        toastr.success(data.message);
                    } else {
                        toastr.error(data.message);
                    }
                })
            },function(){
            });
        }
    }
})();