From dcea723ea42c5284619f99d6e5ee9ca17ae40594 Mon Sep 17 00:00:00 2001 From: Alex Johansson Date: Tue, 28 Sep 2021 01:11:52 +0100 Subject: [PATCH] confirming event gives no visual feedback (#804) --- pages/bookings/index.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pages/bookings/index.tsx b/pages/bookings/index.tsx index 0309e35ed8..64d0bbdc66 100644 --- a/pages/bookings/index.tsx +++ b/pages/bookings/index.tsx @@ -4,7 +4,6 @@ import { BanIcon, CalendarIcon, CheckIcon, ClockIcon, XIcon } from "@heroicons/r import { DotsHorizontalIcon } from "@heroicons/react/solid"; import { BookingStatus } from "@prisma/client"; import dayjs from "dayjs"; -import { useRouter } from "next/router"; import { Fragment } from "react"; import classNames from "@lib/classNames"; @@ -20,8 +19,6 @@ export default function Bookings() { const query = trpc.useQuery(["viewer.bookings"]); const bookings = query.data; - const router = useRouter(); - async function confirmBookingHandler(booking: { id: number }, confirm: boolean) { const res = await fetch("/api/book/confirm", { method: "PATCH", @@ -31,7 +28,7 @@ export default function Bookings() { }, }); if (res.ok) { - await router.replace(router.asPath); + await query.refetch(); } }