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