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:
authored and GitHub committed 2021-10-08 18:58:37 +03:00
1 parent 015b7c18af
commit 35dd3f088c
1 file changed
+2 -2
+2 -2
View File
@@ -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> = {