chore: get oauth client parans from event-type hosts (#20236)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user