confirming event gives no visual feedback (#804)
This commit is contained in:
		
							parent
							
								
									58dde562a3
								
							
						
					
					
						commit
						dcea723ea4
					
				
					 1 changed files with 1 additions and 4 deletions
				
			
		|  | @ -4,7 +4,6 @@ import { BanIcon, CalendarIcon, CheckIcon, ClockIcon, XIcon } from "@heroicons/r | ||||||
| import { DotsHorizontalIcon } from "@heroicons/react/solid"; | import { DotsHorizontalIcon } from "@heroicons/react/solid"; | ||||||
| import { BookingStatus } from "@prisma/client"; | import { BookingStatus } from "@prisma/client"; | ||||||
| import dayjs from "dayjs"; | import dayjs from "dayjs"; | ||||||
| import { useRouter } from "next/router"; |  | ||||||
| import { Fragment } from "react"; | import { Fragment } from "react"; | ||||||
| 
 | 
 | ||||||
| import classNames from "@lib/classNames"; | import classNames from "@lib/classNames"; | ||||||
|  | @ -20,8 +19,6 @@ export default function Bookings() { | ||||||
|   const query = trpc.useQuery(["viewer.bookings"]); |   const query = trpc.useQuery(["viewer.bookings"]); | ||||||
|   const bookings = query.data; |   const bookings = query.data; | ||||||
| 
 | 
 | ||||||
|   const router = useRouter(); |  | ||||||
| 
 |  | ||||||
|   async function confirmBookingHandler(booking: { id: number }, confirm: boolean) { |   async function confirmBookingHandler(booking: { id: number }, confirm: boolean) { | ||||||
|     const res = await fetch("/api/book/confirm", { |     const res = await fetch("/api/book/confirm", { | ||||||
|       method: "PATCH", |       method: "PATCH", | ||||||
|  | @ -31,7 +28,7 @@ export default function Bookings() { | ||||||
|       }, |       }, | ||||||
|     }); |     }); | ||||||
|     if (res.ok) { |     if (res.ok) { | ||||||
|       await router.replace(router.asPath); |       await query.refetch(); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Alex Johansson
						Alex Johansson