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>
This commit is contained in:
Parteek malik
2025-06-04 10:14:08 +00:00
committed by GitHub
co-authored by Anik Dhabal Babu
parent d54ba90304
commit 5404eeedc2
@@ -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>