Scheduling infrastructure for absolutely everyone.
fix: Hotfix/ Dynamic Group Booking Links not working in new booker (#9685)
Hariom Balhara3c3db0b3a631
diff --git a/packages/features/eventtypes/lib/getPublicEvent.ts b/packages/features/eventtypes/lib/getPublicEvent.tsindex 1d3014ffbba..66095bd95b2 100644--- a/packages/features/eventtypes/lib/getPublicEvent.ts+++ b/packages/features/eventtypes/lib/getPublicEvent.ts@@ -7,7 +7,7 @@ import { getAppFromSlug } from "@calcom/app-store/utils";import { getBookingFieldsWithSystemFields } from "@calcom/features/bookings/lib/getBookingFields";import { isRecurringEvent, parseRecurringEvent } from "@calcom/lib";import { WEBAPP_URL } from "@calcom/lib/constants";-import { getDefaultEvent } from "@calcom/lib/defaultEvents";+import { getDefaultEvent, getUsernameList } from "@calcom/lib/defaultEvents";import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";import type { PrismaClient } from "@calcom/prisma/client";import type { BookerLayoutSettings } from "@calcom/prisma/zod-utils";@@ -84,7 +84,7 @@ export const getPublicEvent = async (isTeamEvent: boolean | undefined,prisma: PrismaClient) => {- const usernameList = username.split("+");+ const usernameList = getUsernameList(username);// In case of dynamic group event, we fetch user's data and use the default event.if (usernameList.length > 1) {diff --git a/packages/features/schedules/lib/use-schedule/useSchedule.ts b/packages/features/schedules/lib/use-schedule/useSchedule.tsindex 33046b9bd28..6ea3f433bcf 100644--- a/packages/features/schedules/lib/use-schedule/useSchedule.ts+++ b/packages/features/schedules/lib/use-schedule/useSchedule.ts@@ -1,4 +1,5 @@import dayjs from "@calcom/dayjs";+import { getUsernameList } from "@calcom/lib/defaultEvents";import { trpc } from "@calcom/trpc/react";type UseScheduleWithCacheArgs = {@@ -22,13 +23,12 @@ export const useSchedule = ({}: UseScheduleWithCacheArgs) => {const monthDayjs = month ? dayjs(month) : dayjs();const nextMonthDayjs = monthDayjs.add(1, "month");-// Why the non-null assertions? All of these arguments are checked in the enabled condition,// and the query will not run if they are null. However, the check in `enabled` does// no satisfy typscript.return trpc.viewer.public.slots.getSchedule.useQuery({- usernameList: username && username.indexOf("+") > -1 ? username.split("+") : [username!],+ usernameList: getUsernameList(username ?? ""),eventTypeSlug: eventSlug!,// @TODO: Old code fetched 2 days ago if we were fetching the current month.// Do we want / need to keep that behavior?