Yuki Takei 4 лет назад
Родитель
Сommit
a06c5b799b

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

@@ -89,7 +89,7 @@ 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: installation?.id });
+    const relations = await this.relationRepository.find({ installation });
 
     if (relations.length === 0) {
       return res.json({
@@ -163,7 +163,7 @@ export class SlackCtrl {
     /*
      * forward to GROWI server
      */
-    const relations = await this.relationRepository.find({ installation: installation?.id });
+    const relations = await this.relationRepository.find({ installation });
 
     const promises = relations.map((relation: Relation) => {
       // generate API URL

+ 1 - 1
packages/slackbot-proxy/src/entities/relation.ts

@@ -17,7 +17,7 @@ export class Relation {
   readonly updatedAt: Date;
 
   @ManyToOne(() => Installation)
-  readonly installation: number;
+  readonly installation: Installation;
 
   @Column()
   @Index({ unique: true })