confirming event gives no visual feedback (#804)

pull/802/head^2
Alex Johansson 2021-09-28 01:11:52 +01:00 committed by GitHub
parent 58dde562a3
commit dcea723ea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -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();
}
}