chore: get oauth client parans from event-type hosts (#20236)

This commit is contained in:
Morgan
2025-03-20 08:02:25 +00:00
committed by GitHub
parent c7d9c63390
commit 4762d475cb
6 changed files with 58 additions and 39 deletions
@@ -118,4 +118,19 @@ export class OAuthClientRepository {
},
});
}
async getByEventTypeHosts(eventTypeId: number) {
const hostWithUserPlatformClient = await this.dbRead.prisma.host.findFirst({
select: {
user: { select: { platformOAuthClients: true } },
},
where: {
eventTypeId: eventTypeId,
user: {
isPlatformManaged: true,
},
},
});
return hostWithUserPlatformClient?.user?.platformOAuthClients?.[0] ?? null;
}
}
@@ -265,7 +265,7 @@ describe("Organizations TeamsBookings Endpoints 2024-08-13", () => {
});
describe("get team bookings", () => {
it("should should get bookings by teamId", async () => {
it("should get bookings by teamId", async () => {
return request(app.getHttpServer())
.get(`/v2/organizations/${organization.id}/teams/${team1.id}/bookings`)
.set(CAL_API_VERSION_HEADER, VERSION_2024_08_13)