fix: move cancelled upcoming booking to cancelled tab (#883)
* fix: move cancelled upcoming booking to cancelled tab * fix: lint * Update server/routers/viewer.tsx Co-authored-by: Mihai Colceriu <[email protected]> * fix: also for past bookings Co-authored-by: Alex Johansson <[email protected]>
This commit is contained in:
1 file changed
+2
-2
@@ -28,8 +28,8 @@ export const viewerRouter = createProtectedRouter()
|
||||
const { prisma, user } = ctx;
|
||||
const bookingListingByStatus = input.status;
|
||||
const bookingListingFilters: Record<typeof bookingListingByStatus, Prisma.BookingWhereInput[]> = {
|
||||
upcoming: [{ endTime: { gte: new Date() } }],
|
||||
past: [{ endTime: { lte: new Date() } }],
|
||||
upcoming: [{ endTime: { gte: new Date() }, NOT: { status: { equals: BookingStatus.CANCELLED } } }],
|
||||
past: [{ endTime: { lte: new Date() }, NOT: { status: { equals: BookingStatus.CANCELLED } } }],
|
||||
cancelled: [{ status: { equals: BookingStatus.CANCELLED } }],
|
||||
};
|
||||
const bookingListingOrderby: Record<typeof bookingListingByStatus, Prisma.BookingOrderByInput> = {
|
||||
|
||||
Reference in new issue
Block a user