Merge branch 'main' into chore_Upgrades_and_syncs_Stripe_across_all_packages

This commit is contained in:
Omar López 2023-11-22 20:01:52 -07:00 committed by GitHub
commit 460684806b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 10 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@calcom/web", "name": "@calcom/web",
"version": "3.5.0", "version": "3.5.1",
"private": true, "private": true,
"scripts": { "scripts": {
"analyze": "ANALYZE=true next build", "analyze": "ANALYZE=true next build",

View File

@ -17,7 +17,7 @@ class CalendarEventClass implements CalendarEvent {
organizer!: Person; organizer!: Person;
attendees!: Person[]; attendees!: Person[];
description?: string | null; description?: string | null;
team?: { name: string; members: Person[] }; team?: { name: string; members: Person[]; id: number };
location?: string | null; location?: string | null;
conferenceData?: ConferenceData; conferenceData?: ConferenceData;
additionalInformation?: AdditionalInformation; additionalInformation?: AdditionalInformation;

View File

@ -72,7 +72,12 @@ async function getBookingToDelete(id: number | undefined, uid: string | undefine
hideBranding: true, hideBranding: true,
}, },
}, },
teamId: true, team: {
select: {
id: true,
name: true,
},
},
recurringEvent: true, recurringEvent: true,
title: true, title: true,
eventName: true, eventName: true,
@ -151,11 +156,10 @@ async function handler(req: CustomRequest) {
const teamId = await getTeamIdFromEventType({ const teamId = await getTeamIdFromEventType({
eventType: { eventType: {
team: { id: bookingToDelete.eventType?.teamId ?? null }, team: { id: bookingToDelete.eventType?.team?.id ?? null },
parentId: bookingToDelete?.eventType?.parentId ?? null, parentId: bookingToDelete?.eventType?.parentId ?? null,
}, },
}); });
const triggerForUser = !teamId || (teamId && bookingToDelete.eventType?.parentId); const triggerForUser = !teamId || (teamId && bookingToDelete.eventType?.parentId);
const subscriberOptions = { const subscriberOptions = {
@ -255,7 +259,9 @@ async function handler(req: CustomRequest) {
? [bookingToDelete?.user.destinationCalendar] ? [bookingToDelete?.user.destinationCalendar]
: [], : [],
cancellationReason: cancellationReason, cancellationReason: cancellationReason,
...(teamMembers && { team: { name: "", members: teamMembers } }), ...(teamMembers && {
team: { name: bookingToDelete?.eventType?.team?.name || "Nameless", members: teamMembers, id: teamId! },
}),
seatsPerTimeSlot: bookingToDelete.eventType?.seatsPerTimeSlot, seatsPerTimeSlot: bookingToDelete.eventType?.seatsPerTimeSlot,
seatsShowAttendees: bookingToDelete.eventType?.seatsShowAttendees, seatsShowAttendees: bookingToDelete.eventType?.seatsShowAttendees,
}; };
@ -408,7 +414,7 @@ async function handler(req: CustomRequest) {
if (bookingToDelete.location === DailyLocationType) { if (bookingToDelete.location === DailyLocationType) {
bookingToDelete.user.credentials.push({ bookingToDelete.user.credentials.push({
...FAKE_DAILY_CREDENTIAL, ...FAKE_DAILY_CREDENTIAL,
teamId: bookingToDelete.eventType?.teamId || null, teamId: bookingToDelete.eventType?.team?.id || null,
}); });
} }
@ -540,10 +546,10 @@ async function handler(req: CustomRequest) {
let eventTypeOwnerId; let eventTypeOwnerId;
if (bookingToDelete.eventType?.owner) { if (bookingToDelete.eventType?.owner) {
eventTypeOwnerId = bookingToDelete.eventType.owner.id; eventTypeOwnerId = bookingToDelete.eventType.owner.id;
} else if (bookingToDelete.eventType?.teamId) { } else if (bookingToDelete.eventType?.team?.id) {
const teamOwner = await prisma.membership.findFirst({ const teamOwner = await prisma.membership.findFirst({
where: { where: {
teamId: bookingToDelete.eventType.teamId, teamId: bookingToDelete.eventType?.team.id,
role: MembershipRole.OWNER, role: MembershipRole.OWNER,
}, },
select: { select: {

View File

@ -1079,7 +1079,6 @@ async function handler(
}, },
}; };
}); });
const teamMembers = await Promise.all(teamMemberPromises); const teamMembers = await Promise.all(teamMemberPromises);
const attendeesList = [...invitee, ...guests]; const attendeesList = [...invitee, ...guests];
@ -1887,6 +1886,7 @@ async function handler(
evt.team = { evt.team = {
members: teamMembers, members: teamMembers,
name: eventType.team?.name || "Nameless", name: eventType.team?.name || "Nameless",
id: eventType.team?.id ?? 0,
}; };
} }

View File

@ -160,6 +160,7 @@ export interface CalendarEvent {
team?: { team?: {
name: string; name: string;
members: TeamMember[]; members: TeamMember[];
id: number;
}; };
location?: string | null; location?: string | null;
conferenceCredentialId?: number; conferenceCredentialId?: number;