itizawa 4 лет назад
Родитель
Сommit
4565bd9cfb
1 измененных файлов с 9 добавлено и 3 удалено
  1. 9 3
      packages/slackbot-proxy/src/controllers/slack.ts

+ 9 - 3
packages/slackbot-proxy/src/controllers/slack.ts

@@ -211,9 +211,15 @@ export class SlackCtrl {
     }
 
     /*
-     * forward to GROWI server
-     */
-    const relations = await this.relationRepository.find({ installation });
+    * forward to GROWI server
+    */
+    let relations = await this.relationRepository.find({ installation });
+
+    // For Modal, Send request to only one GROWI
+    if (payload.view != null) {
+      const { growiUri } = JSON.parse(payload.view.private_metadata);
+      relations = relations.filter(relation => relation.growiUri === growiUri);
+    }
 
     const promises = relations.map((relation: Relation) => {
       // generate API URL