diff --git a/packages/features/tasker/tasks/crm/createCRMEvent.ts b/packages/features/tasker/tasks/crm/createCRMEvent.ts index d159b34403..2c3eed966e 100644 --- a/packages/features/tasker/tasks/crm/createCRMEvent.ts +++ b/packages/features/tasker/tasks/crm/createCRMEvent.ts @@ -23,7 +23,6 @@ export async function createCRMEvent(payload: string): Promise { const booking = await prisma.booking.findUnique({ where: { uid: bookingUid, - status: BookingStatus.ACCEPTED, }, include: { user: { @@ -52,6 +51,11 @@ export async function createCRMEvent(payload: string): Promise { throw new Error(`booking not found for uid: ${bookingUid}`); } + if (booking.status !== BookingStatus.ACCEPTED) { + log.info(`Booking status is not ACCEPTED`); + return; + } + if (!booking.user) { throw new Error(`user not found for uid: ${bookingUid}`); }