فهرست منبع

check register

itizawa 4 سال پیش
والد
کامیت
97ba4565d3
2فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 2 2
      packages/slackbot-proxy/src/controllers/slack.ts
  2. 1 0
      packages/slackbot-proxy/src/services/RegisterService.ts

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

@@ -153,11 +153,11 @@ export class SlackCtrl {
     const installation = await this.installationRepository.findByTeamIdOrEnterpriseId(installationId!);
 
     const payload = JSON.parse(body.payload);
-    const { type } = payload;
+    const callBackId = payload?.view?.callback_id;
 
     // register
     // response_urls is an array but the element included is only one.
-    if (type === 'view_submission') {
+    if (callBackId === 'register') {
       await this.registerService.upsertOrderRecord(this.orderRepository, installation, payload);
       await this.registerService.notifyServerUriToSlack(authorizeResult, payload);
       return;

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

@@ -19,6 +19,7 @@ export class RegisterService implements GrowiCommandProcessor {
       trigger_id: body.trigger_id,
       view: {
         type: 'modal',
+        callback_id: 'register',
         title: {
           type: 'plain_text',
           text: 'Register Credentials',