提交 dc3ee536 编写于 作者: R rsercano

refactoring

上级 f1494888
import {ErrorHandler, Notification, SessionManager} from "../../modules";
import {Communicator} from "../../facades";
import { ErrorHandler, Notification } from '/client/imports/modules';
import { Communicator } from '/client/imports/facades';
const UsermanagemenetHelper = function () {
};
UsermanagemenetHelper.prototype = {
proceedDroppingRoleOrUser(notificationButton, command ){
if (!SessionManager.get(SessionManager.strSessionUsermanagementUser)) return;
proceedDroppingRoleOrUser(notificationButton, command, successCallback) {
Notification.modal({
title: 'are-you-sure',
text: 'recover-not-possible',
......@@ -25,7 +22,7 @@ UsermanagemenetHelper.prototype = {
callback: (err, result) => {
if (err || result.error) ErrorHandler.showMeteorFuncError(err, result);
else {
this.initUsers();
successCallback();
Notification.success('deleted-successfully');
}
}
......@@ -36,4 +33,4 @@ UsermanagemenetHelper.prototype = {
}
};
export default new UsermanagemenetHelper();
\ No newline at end of file
export default new UsermanagemenetHelper();
......@@ -607,8 +607,10 @@ UserManagementRoles.prototype = {
},
deleteRole() {
if (!SessionManager.get(SessionManager.strSessionUsermanagementRole)) return;
const command = { dropRole: SessionManager.get(SessionManager.strSessionUsermanagementRole).role };
UsermanagementHelper.proceedDroppingRoleOrUser('#btnCloseUMRoles', command);
UsermanagementHelper.proceedDroppingRoleOrUser('#btnCloseUMRoles', command, () => { this.initRoles(); });
}
};
......
......@@ -181,8 +181,10 @@ UserManagementUsers.prototype = {
},
deleteUser() {
if (!SessionManager.get(SessionManager.strSessionUsermanagementUser)) return;
const command = { dropUser: SessionManager.get(SessionManager.strSessionUsermanagementUser).user };
UsermanagementHelper.proceedDroppingRoleOrUser('#btnCloseUMDB', command);
UsermanagementHelper.proceedDroppingRoleOrUser('#btnCloseUMDB', command, () => { this.initUsers(); });
},
populateTableData(users) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册