|
@@ -468,18 +468,20 @@ module.exports = (crowi) => {
|
|
|
router.put('/global-notification/:id/enabled', loginRequiredStrictly, adminRequired, csrf, addActivity, async(req, res) => {
|
|
router.put('/global-notification/:id/enabled', loginRequiredStrictly, adminRequired, csrf, addActivity, async(req, res) => {
|
|
|
const { id } = req.params;
|
|
const { id } = req.params;
|
|
|
const { isEnabled } = req.body;
|
|
const { isEnabled } = req.body;
|
|
|
- const parameters = {};
|
|
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
if (isEnabled) {
|
|
if (isEnabled) {
|
|
|
await GlobalNotificationSetting.enable(id);
|
|
await GlobalNotificationSetting.enable(id);
|
|
|
- parameters.action = SupportedAction.ACTION_ADMIN_GLOBAL_NOTIFICATION_SETTINGS_ENABLED;
|
|
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
await GlobalNotificationSetting.disable(id);
|
|
await GlobalNotificationSetting.disable(id);
|
|
|
- parameters.action = SupportedAction.ACTION_ADMIN_GLOBAL_NOTIFICATION_SETTINGS_DISABLED;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ const parameters = {
|
|
|
|
|
+ action: isEnabled
|
|
|
|
|
+ ? SupportedAction.ACTION_ADMIN_GLOBAL_NOTIFICATION_SETTINGS_ENABLED
|
|
|
|
|
+ : SupportedAction.ACTION_ADMIN_GLOBAL_NOTIFICATION_SETTINGS_DISABLED,
|
|
|
|
|
+ };
|
|
|
activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
activityEvent.emit('update', res.locals.activity._id, parameters);
|
|
|
|
|
|
|
|
return res.apiv3({ id });
|
|
return res.apiv3({ id });
|