perf: don't fetch all the hosts #18319 followup (#19021)

* perf: don't fetch all the hosts #18319 followup

* undo for user events

* undo for regular user events

* fix: limitHostsToThree -> hostsLimit

* accepting hostLimit prop in <Booker />

* Update booking.tsx

* hostLimit -> hostsLimit
This commit is contained in:
Somay Chauhan authored and GitHub committed 2025-01-31 12:19:21 +02:00
1 parent 8d2dc0bbe5
commit 56cd9cef8b
10 files changed
+138 -66

No files matched your search

@@ -149,10 +149,14 @@ export class OrganizationsEventTypesController {
@Param("teamId", ParseIntPipe) teamId: number,
@Query() queryParams: GetTeamEventTypesQuery_2024_06_14
): Promise<GetTeamEventTypesOutput> {
const { eventSlug } = queryParams;
const { eventSlug, hostsLimit } = queryParams;
if (eventSlug) {
const eventType = await this.organizationsEventTypesService.getTeamEventTypeBySlug(teamId, eventSlug);
const eventType = await this.organizationsEventTypesService.getTeamEventTypeBySlug(
teamId,
eventSlug,
hostsLimit
);
return {
status: SUCCESS_STATUS,
@@ -64,8 +64,12 @@ export class OrganizationsEventTypesService {
return this.teamsEventTypesService.getTeamEventType(teamId, eventTypeId);
}
async getTeamEventTypeBySlug(teamId: number, eventTypeSlug: string): Promise<DatabaseTeamEventType | null> {
return this.teamsEventTypesService.getTeamEventTypeBySlug(teamId, eventTypeSlug);
async getTeamEventTypeBySlug(
teamId: number,
eventTypeSlug: string,
hostsLimit?: number
): Promise<DatabaseTeamEventType | null> {
return this.teamsEventTypesService.getTeamEventTypeBySlug(teamId, eventTypeSlug, hostsLimit);
}
async getTeamEventTypes(teamId: number): Promise<DatabaseTeamEventType[]> {