Imprv/gw6118 restrict max accordion num
@@ -376,6 +376,13 @@ module.exports = (crowi) => {
* description: Succeeded to create slack app integration
*/
router.put('/slack-app-integrations', loginRequiredStrictly, adminRequired, csrf, async(req, res) => {
+ const SlackAppIntegrationRecordsNum = await SlackAppIntegration.countDocuments();
+ if (SlackAppIntegrationRecordsNum >= 10) {
+ const msg = 'Not be able to create more than 10 slack workspace integration settings';
+ logger.error('Error', msg);
+ return res.apiv3Err(new ErrorV3(msg, 'create-slackAppIntegeration-failed'), 500);
+ }
+
let checkTokens;
let tokenGtoP;
let tokenPtoG;