OOPS, sorry guys (#655)
This commit is contained in:
		
							parent
							
								
									1aabf6dfdf
								
							
						
					
					
						commit
						738ee5d992
					
				
					 1 changed files with 12 additions and 2 deletions
				
			
		|  | @ -12,7 +12,7 @@ import { ClockIcon, XIcon } from "@heroicons/react/outline"; | ||||||
| import Loader from "@components/Loader"; | import Loader from "@components/Loader"; | ||||||
| import { Button } from "@components/ui/Button"; | import { Button } from "@components/ui/Button"; | ||||||
| import { getSession } from "@lib/auth"; | import { getSession } from "@lib/auth"; | ||||||
| import { BookingStatus } from "@prisma/client"; | import { BookingStatus, User } from "@prisma/client"; | ||||||
| 
 | 
 | ||||||
| export default function Bookings({ bookings }) { | export default function Bookings({ bookings }) { | ||||||
|   // eslint-disable-next-line @typescript-eslint/no-unused-vars
 |   // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | ||||||
|  | @ -208,6 +208,16 @@ export async function getServerSideProps(context) { | ||||||
|   if (!session) { |   if (!session) { | ||||||
|     return { redirect: { permanent: false, destination: "/auth/login" } }; |     return { redirect: { permanent: false, destination: "/auth/login" } }; | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|  |   const user: User = await prisma.user.findUnique({ | ||||||
|  |     where: { | ||||||
|  |       id: session.user.id, | ||||||
|  |     }, | ||||||
|  |     select: { | ||||||
|  |       email: true, | ||||||
|  |     }, | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|   const b = await prisma.booking.findMany({ |   const b = await prisma.booking.findMany({ | ||||||
|     where: { |     where: { | ||||||
|       OR: [ |       OR: [ | ||||||
|  | @ -217,7 +227,7 @@ export async function getServerSideProps(context) { | ||||||
|         { |         { | ||||||
|           attendees: { |           attendees: { | ||||||
|             some: { |             some: { | ||||||
|               id: session.user.id, |               email: user.email, | ||||||
|             }, |             }, | ||||||
|           }, |           }, | ||||||
|         }, |         }, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Alex van Andel
						Alex van Andel