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

implement findByTeamIdOrEnterpriseId

itizawa 5 лет назад
Родитель
Сommit
9389c855b3
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      packages/slackbot-proxy/src/repositories/installation.ts

+ 9 - 0
packages/slackbot-proxy/src/repositories/installation.ts

@@ -11,4 +11,13 @@ export class InstallationRepository extends Repository<Installation> {
     return this.findOne(id);
     return this.findOne(id);
   }
   }
 
 
+  async findByTeamIdOrEnterpriseId(installation:Partial<Installation>): Promise<Installation|undefined> {
+    return this.findOne({
+      where: [
+        { teamId: installation.teamId },
+        { enterpriseId: installation.enterpriseId },
+      ],
+    });
+  }
+
 }
 }