fix: Hotfix/ Dynamic Group Booking Links not working in new booker (#9685)
* Debuglogs
* Derive group usernames correctly
* Revert "Debuglogs"
This reverts commit d93f031589
.
This commit is contained in:
parent
4748641c22
commit
3c3db0b3a6
|
@ -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) {
|
||||
|
|
|
@ -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?
|
||||
|
|
Loading…
Reference in New Issue
Block a user