fix: Across Org Scenarios - Wrong links for event and team (#12358)

Co-authored-by: sean-brydon <[email protected]>
This commit is contained in:
Hariom Balharaandsean-brydon authored and GitHub committed 2023-12-19 19:33:30 +10:00
1 parent f1caaad536
commit e5e0fa97eb
35 files changed
+570 -154

No files matched your search

-7
View File
@@ -1,7 +0,0 @@
import { WEBAPP_URL } from "../constants";
import { getBrand } from "./getBrand";
export const getBookerUrl = async (user: { organizationId: number | null }) => {
const orgBrand = await getBrand(user.organizationId);
return orgBrand?.fullDomain ?? WEBAPP_URL;
};
+2 -2
View File
@@ -1,12 +1,12 @@
import { Prisma } from "@prisma/client";
import { getAppFromSlug } from "@calcom/app-store/utils";
import { getOrgFullOrigin } from "@calcom/ee/organizations/lib/orgDomains";
import prisma, { baseEventTypeSelect } from "@calcom/prisma";
import { SchedulingType } from "@calcom/prisma/enums";
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { WEBAPP_URL } from "../../../constants";
import { getBookerBaseUrlSync } from "../../../getBookerUrl/client";
import { getTeam, getOrg } from "../../repository/team";
export type TeamWithMembers = Awaited<ReturnType<typeof getTeamWithMembers>>;
@@ -158,7 +158,7 @@ export async function getTeamWithMembers(args: {
.map((membership) => membership.team.slug)
: null,
avatar: `${WEBAPP_URL}/${m.user.username}/avatar.png`,
orgOrigin: getOrgFullOrigin(m.user.organization?.slug || ""),
bookerUrl: getBookerBaseUrlSync(m.user.organization?.slug || ""),
connectedApps: !isTeamView
? credentials?.map((cred) => {
const appSlug = cred.app?.slug;