prettier fix attempt-2
parent
5453af6d6e
commit
301c132815
|
@ -88,8 +88,7 @@ async function createOrlistAllBookings(
|
||||||
|
|
||||||
if (booking) {
|
if (booking) {
|
||||||
res.status(201).json({ booking, message: "Booking created successfully" });
|
res.status(201).json({ booking, message: "Booking created successfully" });
|
||||||
|
// Create Calendar Event for webhook payload
|
||||||
// Create Calendar Event for webhook payload
|
|
||||||
const eventType = await prisma.eventType
|
const eventType = await prisma.eventType
|
||||||
.findUnique({ where: { id: booking.eventTypeId as number } })
|
.findUnique({ where: { id: booking.eventTypeId as number } })
|
||||||
.then((data) => schemaEventTypeReadPublic.parse(data))
|
.then((data) => schemaEventTypeReadPublic.parse(data))
|
||||||
|
@ -115,24 +114,24 @@ async function createOrlistAllBookings(
|
||||||
language: {
|
language: {
|
||||||
translate: fallbackTfunction,
|
translate: fallbackTfunction,
|
||||||
locale: "en",
|
locale: "en",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
attendees: [],
|
attendees: [],
|
||||||
location: "",
|
location: "",
|
||||||
destinationCalendar: null,
|
destinationCalendar: null,
|
||||||
hideCalendar: false,
|
hideCalendar: false,
|
||||||
uid: booking.uid,
|
uid: booking.uid,
|
||||||
metadata: {}
|
metadata: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Send Webhook call if hooked to BOOKING_CREATED
|
// Send Webhook call if hooked to BOOKING_CREATED
|
||||||
const triggerEvent = WebhookTriggerEvents.BOOKING_CREATED;
|
const triggerEvent = WebhookTriggerEvents.BOOKING_CREATED;
|
||||||
const subscriberOptions = {
|
const subscriberOptions = {
|
||||||
userId,
|
userId,
|
||||||
eventTypeId: booking.eventTypeId as number,
|
eventTypeId: booking.eventTypeId as number,
|
||||||
triggerEvent,
|
triggerEvent,
|
||||||
};
|
};
|
||||||
|
|
||||||
const subscribers = await getWebhooks(subscriberOptions);
|
const subscribers = await getWebhooks(subscriberOptions);
|
||||||
const bookingId = booking?.id;
|
const bookingId = booking?.id;
|
||||||
const promises = subscribers.map((sub) =>
|
const promises = subscribers.map((sub) =>
|
||||||
|
|
Loading…
Reference in New Issue