Explorar o código

userNotifications

itizawa %!s(int64=6) %!d(string=hai) anos
pai
achega
6d6eb752f3

+ 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 });
   });