zahmis 4 лет назад
Родитель
Сommit
85fdcd16c3

+ 4 - 3
packages/app/src/server/routes/apiv3/slack-integration.js

@@ -40,7 +40,6 @@ module.exports = (crowi) => {
         + 'Please unregister the information registered in the proxy and setup `/growi register` again.',
       });
     }
-
     next();
   }
 
@@ -166,8 +165,10 @@ module.exports = (crowi) => {
       client = generateClientForResponse();
     }
     else {
-      const slackAppIntegration = await SlackAppIntegration.findOne({ tokenPtoG });
-      client = generateClientForResponse(slackAppIntegration.tokenGtoP);
+      const SlackAppIntegrationMock = mongoose.model('SlackAppIntegrationMock');
+      const slackAppIntegrationMock = await SlackAppIntegrationMock.findOne({ tokenPtoG });
+      // const slackAppIntegration = await SlackAppIntegration.findOne({ tokenPtoG });
+      client = generateClientForResponse(slackAppIntegrationMock.tokenGtoP);
     }
 
     const args = body.text.split(' ');

+ 1 - 0
packages/slack/src/utils/post-ephemeral-errors.ts

@@ -9,6 +9,7 @@ export const postEphemeralErrors = async(
     userId: string,
     botToken: string,
 ): Promise<WebAPICallResult|void> => {
+  console.log(12);
 
   if (rejectedResults.length > 0) {
     // eslint-disable-next-line @typescript-eslint/no-non-null-assertion

+ 1 - 1
packages/slackbot-proxy/src/controllers/slack.ts

@@ -199,7 +199,7 @@ export class SlackCtrl {
      */
     if (relationsForBroadcastUse.length > 0) {
       isCommandPermitted = true;
-      this.sendCommand(growiCommand, relationsForBroadcastUse, body);
+      return this.sendCommand(growiCommand, relationsForBroadcastUse, body);
     }
 
     if (!isCommandPermitted) {