Stops users who are not in getting the "Requires confirmation" email (#3084)

* Update Email

* Remove console.debug

* Remove redundant assignment

Co-authored-by: Omar López <zomars@me.com>

* Update apps/web/pages/api/book/confirm.ts

* Fix E2E test

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
sean-brydon
2022-06-17 09:02:29 +00:00
committed by GitHub
co-authored by Peer Richelsen Omar López kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent 2e79446667
commit d44c8f7912
6 changed files with 7 additions and 3 deletions
+2
View File
@@ -105,6 +105,7 @@ async function patchHandler(req: NextApiRequest) {
eventType: {
select: {
recurringEvent: true,
requiresConfirmation: true,
},
},
location: true,
@@ -176,6 +177,7 @@ async function patchHandler(req: NextApiRequest) {
location: booking.location ?? "",
uid: booking.uid,
destinationCalendar: booking?.destinationCalendar || currentUser.destinationCalendar,
requiresConfirmation: booking?.eventType?.requiresConfirmation ?? false,
};
const recurringEvent = parseRecurringEvent(booking.eventType?.recurringEvent);
+1
View File
@@ -402,6 +402,7 @@ async function handler(req: NextApiRequest) {
/** For team events & dynamic collective events, we will need to handle each member destinationCalendar eventually */
destinationCalendar: eventType.destinationCalendar || organizerUser.destinationCalendar,
hideCalendarNotes: eventType.hideCalendarNotes,
requiresConfirmation: eventType.requiresConfirmation ?? false,
};
if (eventType.schedulingType === SchedulingType.COLLECTIVE) {
+1
View File
@@ -75,6 +75,7 @@ test.describe("Integrations", () => {
body.payload.uid = dynamic;
body.payload.bookingId = dynamic;
body.payload.additionalInformation = dynamic;
body.payload.requiresConfirmation = dynamic;
// if we change the shape of our webhooks, we can simply update this by clicking `u`
// console.log("BODY", body);
@@ -1 +1 @@
{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30 min","title":"30 min between PRO and Test Testson","description":"","additionalNotes":"","customInputs":{},"startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"name":"PRO","email":"[redacted/dynamic]","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"},"attendees":[{"email":"test@example.com","name":"Test Testson","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"}],"location":"[redacted/dynamic]","destinationCalendar":null,"hideCalendarNotes":false,"uid":"[redacted/dynamic]","bookingId":"[redacted/dynamic]","metadata":{},"additionalInformation":"[redacted/dynamic]"}}
{"triggerEvent":"BOOKING_CREATED","createdAt":"[redacted/dynamic]","payload":{"type":"30 min","title":"30 min between PRO and Test Testson","description":"","additionalNotes":"","customInputs":{},"startTime":"[redacted/dynamic]","endTime":"[redacted/dynamic]","organizer":{"name":"PRO","email":"[redacted/dynamic]","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"},"attendees":[{"email":"test@example.com","name":"Test Testson","timeZone":"[redacted/dynamic]","language":"[redacted/dynamic]"}],"location":"[redacted/dynamic]","destinationCalendar":null,"hideCalendarNotes":false,"requiresConfirmation":"[redacted/dynamic]","uid":"[redacted/dynamic]","bookingId":"[redacted/dynamic]","metadata":{},"additionalInformation":"[redacted/dynamic]"}}
@@ -108,14 +108,13 @@ export function LocationInfo(props: { calEvent: CalendarEvent; t: TFunction }) {
/>
);
}
return (
<Info
label={t("where")}
withSpacer
description={providerName || props.calEvent.location}
extraInfo={
providerName === "Zoom" || providerName === "Google" ? (
(providerName === "Zoom" || providerName === "Google") && props.calEvent.requiresConfirmation ? (
<p style={{ color: "#494949", fontWeight: 400, lineHeight: "24px" }}>
<>{t("meeting_url_provided_after_confirmed")}</>
</p>
+1
View File
@@ -116,6 +116,7 @@ export interface CalendarEvent {
uid?: string | null;
videoCallData?: VideoCallData;
paymentInfo?: PaymentInfo | null;
requiresConfirmation?: boolean | null;
destinationCalendar?: DestinationCalendar | null;
cancellationReason?: string | null;
rejectionReason?: string | null;