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

separate methods by type and action_id

kaori 5 лет назад
Родитель
Сommit
d92f68331c

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

@@ -191,12 +191,14 @@ export class SlackCtrl {
     const { type } = payload;
     const { type } = payload;
 
 
     try {
     try {
-      switch (type) {
-        case 'view_submission':
-          await handleViewSubmission(payload);
-          break;
-        default:
-          break;
+      if (type === 'view_submission') {
+        switch (payload.response_urls[0].action_id) {
+          case 'show_proxy_url':
+            await handleViewSubmission(payload);
+            break;
+          default:
+            break;
+        }
       }
       }
     }
     }
     catch (error) {
     catch (error) {

+ 1 - 1
packages/slackbot-proxy/src/services/RegisterService.ts

@@ -43,7 +43,7 @@ export class RegisterService implements GrowiCommandProcessor {
               text: 'Select a channel to post the proxy URL on',
               text: 'Select a channel to post the proxy URL on',
             },
             },
             element: {
             element: {
-              action_id: 'post_proxy_url_id',
+              action_id: 'show_proxy_url',
               type: 'conversations_select',
               type: 'conversations_select',
               response_url_enabled: true,
               response_url_enabled: true,
               default_to_current_conversation: true,
               default_to_current_conversation: true,