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 <colceriumi@gmail.com> * fix: also for past bookings Co-authored-by: Alex Johansson <alexander@n1s.se>pull/889/head
parent
015b7c18af
commit
35dd3f088c
|
@ -28,8 +28,8 @@ export const viewerRouter = createProtectedRouter()
|
||||||
const { prisma, user } = ctx;
|
const { prisma, user } = ctx;
|
||||||
const bookingListingByStatus = input.status;
|
const bookingListingByStatus = input.status;
|
||||||
const bookingListingFilters: Record<typeof bookingListingByStatus, Prisma.BookingWhereInput[]> = {
|
const bookingListingFilters: Record<typeof bookingListingByStatus, Prisma.BookingWhereInput[]> = {
|
||||||
upcoming: [{ endTime: { gte: new Date() } }],
|
upcoming: [{ endTime: { gte: new Date() }, NOT: { status: { equals: BookingStatus.CANCELLED } } }],
|
||||||
past: [{ endTime: { lte: new Date() } }],
|
past: [{ endTime: { lte: new Date() }, NOT: { status: { equals: BookingStatus.CANCELLED } } }],
|
||||||
cancelled: [{ status: { equals: BookingStatus.CANCELLED } }],
|
cancelled: [{ status: { equals: BookingStatus.CANCELLED } }],
|
||||||
};
|
};
|
||||||
const bookingListingOrderby: Record<typeof bookingListingByStatus, Prisma.BookingOrderByInput> = {
|
const bookingListingOrderby: Record<typeof bookingListingByStatus, Prisma.BookingOrderByInput> = {
|
||||||
|
|
Loading…
Reference in New Issue