From 5404eeedc29c19852664db3d1d41087e4d7f3fb9 Mon Sep 17 00:00:00 2001 From: Parteek malik <64765095+parteekmalik@users.noreply.github.com> Date: Wed, 4 Jun 2025 15:44:08 +0530 Subject: [PATCH] fix: no show not updating in sync (#21687) * fix: no show not updating in sync * fix footer in no show dialog * using await --------- Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> --- apps/web/components/booking/BookingListItem.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/web/components/booking/BookingListItem.tsx b/apps/web/components/booking/BookingListItem.tsx index 058a0c7d91..bfea1cd38b 100644 --- a/apps/web/components/booking/BookingListItem.tsx +++ b/apps/web/components/booking/BookingListItem.tsx @@ -941,7 +941,7 @@ const Attendee = (attendeeProps: AttendeeProps & NoShowProps) => { const noShowMutation = trpc.viewer.loggedInViewerRouter.markNoShow.useMutation({ onSuccess: async (data) => { showToast(data.message, "success"); - utils.viewer.bookings.invalidate(); + await utils.viewer.bookings.invalidate(); }, onError: (err) => { showToast(err.message, "error"); @@ -1030,9 +1030,11 @@ const GroupedAttendees = (groupedAttendeeProps: GroupedAttendeeProps) => { }; }); const { t } = useLocale(); + const utils = trpc.useUtils(); const noShowMutation = trpc.viewer.loggedInViewerRouter.markNoShow.useMutation({ onSuccess: async (data) => { showToast(t(data.message), "success"); + await utils.viewer.bookings.invalidate(); }, onError: (err) => { showToast(err.message, "error"); @@ -1133,6 +1135,7 @@ const NoShowAttendeesDialog = ({ })) ); + const utils = trpc.useUtils(); const noShowMutation = trpc.viewer.loggedInViewerRouter.markNoShow.useMutation({ onSuccess: async (data) => { const newValue = data.attendees[0]; @@ -1142,6 +1145,7 @@ const NoShowAttendeesDialog = ({ ) ); showToast(t(data.message), "success"); + await utils.viewer.bookings.invalidate(); }, onError: (err) => { showToast(err.message, "error"); @@ -1172,7 +1176,7 @@ const NoShowAttendeesDialog = ({ ))} - + {t("done")}