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 <[email protected]>
This commit is contained in:
Parteek malikandAnik Dhabal Babu authored and GitHub committed 2025-06-04 10:14:08 +00:00
1 parent d54ba90304
commit 5404eeedc2
1 file changed
+6 -2
@@ -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 = ({
</div>
</form>
))}
<DialogFooter>
<DialogFooter noSticky>
<DialogClose>{t("done")}</DialogClose>
</DialogFooter>
</DialogContent>