فهرست منبع

userNotifications

itizawa 6 سال پیش
والد
کامیت
6d6eb752f3
2فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 2 0
      src/client/js/services/AdminNotificationContainer.js
  2. 5 0
      src/server/routes/apiv3/notification-setting.js

+ 2 - 0
src/client/js/services/AdminNotificationContainer.js

@@ -48,6 +48,8 @@ export default class AdminNotificationContainer extends Container {
         webhookUrl: notificationParams.webhookUrl || '',
         isIncomingWebhookPrioritized: notificationParams.isIncomingWebhookPrioritized || false,
         slackToken: notificationParams.slackToken || '',
+        userNotifications: notificationParams.userNotifications,
+        globalNotifications: notificationParams.globalNotifications,
       });
 
     }

+ 5 - 0
src/server/routes/apiv3/notification-setting.js

@@ -82,10 +82,15 @@ module.exports = (crowi) => {
    *                      description: notification params
    */
   router.get('/', loginRequiredStrictly, adminRequired, async(req, res) => {
+    const UpdatePost = crowi.model('UpdatePost');
+    const GlobalNotificationSetting = crowi.model('GlobalNotificationSetting');
+
     const notificationParams = {
       webhookUrl: await crowi.configManager.getConfig('notification', 'slack:incomingWebhookUrl'),
       isIncomingWebhookPrioritized: await crowi.configManager.getConfig('notification', 'slack:isIncomingWebhookPrioritized'),
       slackToken: await crowi.configManager.getConfig('notification', 'slack:token'),
+      userNotifications: await UpdatePost.findAll(),
+      globalNotifications: await GlobalNotificationSetting.findAll(),
     };
     return res.apiv3({ notificationParams });
   });