Просмотр исходного кода

moving installation from /commands to /interactions

kaori 5 лет назад
Родитель
Сommit
675b4438e7
1 измененных файлов с 7 добавлено и 6 удалено
  1. 7 6
      packages/slackbot-proxy/src/controllers/slack.ts

+ 7 - 6
packages/slackbot-proxy/src/controllers/slack.ts

@@ -137,6 +137,13 @@ export class SlackCtrl {
       return;
       return;
     }
     }
 
 
+    return;
+  }
+
+  @Post('/interactions')
+  async handleInteraction(@BodyParams() body:{[key:string]:string}, @Res() res: Res): Promise<void|string> {
+    logger.info('receive interaction', body);
+
     const installation = await this.installationRepository.findByID('1');
     const installation = await this.installationRepository.findByID('1');
     if (installation == null) {
     if (installation == null) {
       throw new Error('installation is reqiured');
       throw new Error('installation is reqiured');
@@ -158,12 +165,6 @@ export class SlackCtrl {
     return;
     return;
   }
   }
 
 
-  @Post('/interactions')
-  async handleInteraction(@BodyParams() body:{[key:string]:string}, @Res() res: Res): Promise<void|string> {
-    logger.info('receive interaction', body);
-    return;
-  }
-
   @Post('/events')
   @Post('/events')
   async handleEvent(@BodyParams() body:{[key:string]:string}, @Res() res: Res): Promise<void|string> {
   async handleEvent(@BodyParams() body:{[key:string]:string}, @Res() res: Res): Promise<void|string> {
     // eslint-disable-next-line max-len
     // eslint-disable-next-line max-len