소스 검색

Merge pull request #3940 from weseek/fix/bug-not-function-postEphemeralError

Fix/bug not function post ephemeral error
Yuki Takei 4 년 전
부모
커밋
141cc50e69
2개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 1
      packages/slackbot-proxy/src/controllers/slack.ts
  2. 5 1
      packages/slackbot-proxy/src/services/SelectGrowiService.ts

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

@@ -152,7 +152,10 @@ export class SlackCtrl {
     const installationId = authorizeResult.enterpriseId || authorizeResult.teamId;
     // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     const installation = await this.installationRepository.findByTeamIdOrEnterpriseId(installationId!);
-    const relations = await this.relationRepository.find({ installation });
+    const relations = await this.relationRepository.createQueryBuilder('relation')
+      .where('relation.installationId = :id', { id: installation?.id })
+      .leftJoinAndSelect('relation.installation', 'installation')
+      .getMany();
 
     if (relations.length === 0) {
       return res.json({

+ 5 - 1
packages/slackbot-proxy/src/services/SelectGrowiService.ts

@@ -93,7 +93,11 @@ export class SelectGrowiService implements GrowiCommandProcessor {
     // ovverride trigger_id
     sendCommandBody.trigger_id = triggerId;
 
-    const relation = await this.relationRepository.findOne({ installation, growiUri });
+    const relation = await this.relationRepository.createQueryBuilder('relation')
+      .where('relation.growiUri =:growiUri', { growiUri })
+      .andWhere('relation.installationId = :id', { id: installation?.id })
+      .leftJoinAndSelect('relation.installation', 'installation')
+      .getOne();
 
     if (relation == null) {
       // TODO: postEphemeralErrors