|
|
@@ -270,17 +270,14 @@ module.exports = (crowi) => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- function checkConnectedToSlack(res) {
|
|
|
+ router.post('/test-notification-to-slack-work-space', async(req, res) => {
|
|
|
+
|
|
|
const isConnectedToSlack = crowi.slackBotService.isConnectedToSlack;
|
|
|
if (!isConnectedToSlack) {
|
|
|
const msg = 'Bot User OAuth Token is not setup.';
|
|
|
logger.error('Error', msg);
|
|
|
return res.apiv3Err(new ErrorV3(msg, 'not-setup-slack-bot-token', 400));
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- router.post('/test-notification-to-slack-work-space', async(req, res) => {
|
|
|
- checkConnectedToSlack(res);
|
|
|
|
|
|
const slackBotToken = crowi.configManager.getConfig('crowi', 'slackbot:token');
|
|
|
this.client = new WebClient(slackBotToken, { logLevel: LogLevel.DEBUG });
|