fix: preview url for booking page (#12973)
* fix: preview url for booking page * chore: use cal url * chore: fix tests --------- Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
parent
7015c8909f
commit
8c8401330a
|
@ -8,7 +8,7 @@ import { expect, vi } from "vitest";
|
|||
import "vitest-fetch-mock";
|
||||
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { CAL_URL } from "@calcom/lib/constants";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { BookingStatus } from "@calcom/prisma/enums";
|
||||
|
@ -382,7 +382,7 @@ export function expectSuccessfulBookingCreationEmails({
|
|||
bookingTimeRange?: { start: Date; end: Date };
|
||||
booking: { uid: string; urlOrigin?: string };
|
||||
}) {
|
||||
const bookingUrlOrigin = booking.urlOrigin || WEBAPP_URL;
|
||||
const bookingUrlOrigin = booking.urlOrigin || CAL_URL;
|
||||
expect(emails).toHaveEmail(
|
||||
{
|
||||
titleTag: "confirmed_event_type_subject",
|
||||
|
@ -742,7 +742,7 @@ export function expectBookingRequestRescheduledEmails({
|
|||
booking: { uid: string; urlOrigin?: string };
|
||||
bookNewTimePath: string;
|
||||
}) {
|
||||
const bookingUrlOrigin = booking.urlOrigin || WEBAPP_URL;
|
||||
const bookingUrlOrigin = booking.urlOrigin || CAL_URL;
|
||||
|
||||
expect(emails).toHaveEmail(
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
|
|||
import { describe, expect } from "vitest";
|
||||
|
||||
import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { CAL_URL, WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { ErrorCode } from "@calcom/lib/errorCodes";
|
||||
import { resetTestEmails } from "@calcom/lib/testEmails";
|
||||
import { BookingStatus } from "@calcom/prisma/enums";
|
||||
|
@ -218,7 +218,7 @@ describe("handleNewBooking", () => {
|
|||
expectSuccessfulBookingCreationEmails({
|
||||
booking: {
|
||||
uid: createdBooking.uid!,
|
||||
urlOrigin: org ? org.urlOrigin : WEBAPP_URL,
|
||||
urlOrigin: org ? org.urlOrigin : CAL_URL,
|
||||
},
|
||||
booker,
|
||||
organizer,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
import { describe, expect } from "vitest";
|
||||
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { WEBAPP_URL, CAL_URL } from "@calcom/lib/constants";
|
||||
import { ErrorCode } from "@calcom/lib/errorCodes";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { BookingStatus } from "@calcom/prisma/enums";
|
||||
|
@ -209,7 +209,7 @@ describe("handleNewBooking", () => {
|
|||
booking: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
uid: createdBookings[0].uid!,
|
||||
urlOrigin: WEBAPP_URL,
|
||||
urlOrigin: CAL_URL,
|
||||
},
|
||||
organizer,
|
||||
emails,
|
||||
|
@ -555,7 +555,7 @@ describe("handleNewBooking", () => {
|
|||
booking: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
uid: createdBookings[0].uid!,
|
||||
urlOrigin: WEBAPP_URL,
|
||||
urlOrigin: CAL_URL,
|
||||
},
|
||||
organizer,
|
||||
emails,
|
||||
|
@ -769,7 +769,7 @@ describe("handleNewBooking", () => {
|
|||
booking: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
uid: createdBookings[0].uid!,
|
||||
urlOrigin: WEBAPP_URL,
|
||||
urlOrigin: CAL_URL,
|
||||
},
|
||||
booker,
|
||||
organizer,
|
||||
|
|
|
@ -3,7 +3,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
|
|||
import { describe, expect } from "vitest";
|
||||
|
||||
import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { CAL_URL, WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { ErrorCode } from "@calcom/lib/errorCodes";
|
||||
import { SchedulingType } from "@calcom/prisma/enums";
|
||||
import { BookingStatus } from "@calcom/prisma/enums";
|
||||
|
@ -1279,7 +1279,7 @@ describe("handleNewBooking", () => {
|
|||
booking: {
|
||||
uid: createdBooking.uid!,
|
||||
// All booking links are of WEBAPP_URL and not of the org because the team isn't part of the org
|
||||
urlOrigin: WEBAPP_URL,
|
||||
urlOrigin: CAL_URL,
|
||||
},
|
||||
booker,
|
||||
organizer,
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { WEBAPP_URL } from "../constants";
|
||||
import { CAL_URL } from "../constants";
|
||||
import { getBrand } from "../server/getBrand";
|
||||
|
||||
export const getBookerBaseUrl = async (user: { organizationId: number | null }) => {
|
||||
const orgBrand = await getBrand(user.organizationId);
|
||||
return orgBrand?.fullDomain ?? WEBAPP_URL;
|
||||
return orgBrand?.fullDomain ?? CAL_URL;
|
||||
};
|
||||
|
||||
export const getTeamBookerUrl = async (team: { organizationId: number | null }) => {
|
||||
const orgBrand = await getBrand(team.organizationId);
|
||||
return orgBrand?.fullDomain ?? WEBAPP_URL;
|
||||
return orgBrand?.fullDomain ?? CAL_URL;
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-u
|
|||
|
||||
import { TRPCError } from "@trpc/server";
|
||||
|
||||
import { WEBAPP_URL } from "./constants";
|
||||
import { CAL_URL } from "./constants";
|
||||
import { getBookerBaseUrl } from "./getBookerUrl/server";
|
||||
|
||||
interface getEventTypeByIdProps {
|
||||
|
@ -271,7 +271,7 @@ export default async function getEventTypeById({
|
|||
? await getBookerBaseUrl({ organizationId: restEventType.team.parentId })
|
||||
: restEventType.owner
|
||||
? await getBookerBaseUrl(restEventType.owner)
|
||||
: WEBAPP_URL,
|
||||
: CAL_URL,
|
||||
children: restEventType.children.flatMap((ch) =>
|
||||
ch.owner !== null
|
||||
? {
|
||||
|
|
Loading…
Reference in New Issue
Block a user