Feat - disable notes (#2249)
* Feat - disable notes Stops notes from showing in calendar when checked. * Removing index rename * Update apps/web/lib/integrations/calendar/interfaces/Calendar.ts Co-authored-by: Omar López <[email protected]> * Rename to hideCalendarNotes * Update schema.prisma * Update webhookResponse-chromium.txt Co-authored-by: Bailey Pumfleet <[email protected]> Co-authored-by: Omar López <[email protected]> Co-authored-by: Bailey Pumfleet <[email protected]> Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
7 files changed
+22
-9
No files matched your search
@@ -102,12 +102,17 @@ export const createEvent = async (credential: Credential, calEvent: CalendarEven
|
||||
const calendar = getCalendar(credential);
|
||||
let success = true;
|
||||
|
||||
// Check if the disabledNotes flag is set to true
|
||||
if (calEvent.hideCalendarNotes) {
|
||||
calEvent.description = "Notes have been hidden by the organiser"; // TODO: i18n this string?
|
||||
}
|
||||
|
||||
const creationResult = calendar
|
||||
? await calendar.createEvent(calEvent).catch((e) => {
|
||||
log.error("createEvent failed", e, calEvent);
|
||||
success = false;
|
||||
return undefined;
|
||||
})
|
||||
log.error("createEvent failed", e, calEvent);
|
||||
success = false;
|
||||
return undefined;
|
||||
})
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
@@ -131,10 +136,10 @@ export const updateEvent = async (
|
||||
const updatedResult =
|
||||
calendar && bookingRefUid
|
||||
? await calendar.updateEvent(bookingRefUid, calEvent).catch((e) => {
|
||||
log.error("updateEvent failed", e, calEvent);
|
||||
success = false;
|
||||
return undefined;
|
||||
})
|
||||
log.error("updateEvent failed", e, calEvent);
|
||||
success = false;
|
||||
return undefined;
|
||||
})
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "EventType" ADD COLUMN "hideCalendarNotes" BOOLEAN NOT NULL DEFAULT false;
|
||||
@@ -58,6 +58,7 @@ model EventType {
|
||||
periodCountCalendarDays Boolean?
|
||||
requiresConfirmation Boolean @default(false)
|
||||
disableGuests Boolean @default(false)
|
||||
hideCalendarNotes Boolean @default(false)
|
||||
minimumBookingNotice Int @default(120)
|
||||
beforeEventBuffer Int @default(0)
|
||||
afterEventBuffer Int @default(0)
|
||||
|
||||
Vendored
+1
@@ -91,6 +91,7 @@ export interface CalendarEvent {
|
||||
destinationCalendar?: DestinationCalendar | null;
|
||||
cancellationReason?: string | null;
|
||||
rejectionReason?: string | null;
|
||||
hideCalendarNotes?: boolean;
|
||||
}
|
||||
|
||||
export interface EntryPoint {
|
||||
|
||||
Reference in new issue
Block a user