Skip to content

Commit

Permalink
Make sure to invalidate BOTH digital and physical reservations
Browse files Browse the repository at this point in the history
when deleting them.
  • Loading branch information
spaceo committed Dec 2, 2023
1 parent ea16a4c commit f404a28
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { UseMutateFunction, useQueryClient } from "react-query";
import Modal from "../../../../core/utils/modal";
import { useText } from "../../../../core/utils/text";
import DeleteReservationContent from "./delete-reservation-content";
import { useDeleteReservations } from "../../../../core/fbs/fbs";
import {
getGetReservationsV2QueryKey,
useDeleteReservations
} from "../../../../core/fbs/fbs";
import {
getGetV1UserReservationsQueryKey,
useDeleteV1UserReservationsIdentifier
Expand Down Expand Up @@ -88,7 +91,9 @@ const DeleteReservationModal: FC<DeleteReservationModalProps> = ({
// Since we got success, we can assume that all reservations
// were successfully deleted.
setDeletedReservations(reservations.length);
// Invalidate queries to update the UI.
queryClient.invalidateQueries(getGetV1UserReservationsQueryKey());
queryClient.invalidateQueries(getGetReservationsV2QueryKey());
}
});

Expand Down

0 comments on commit f404a28

Please sign in to comment.