feat: new filter added (#4612)
* feat: new filter added * fix: type error * Update packages/ui/v2/core/layouts/BookingLayout.tsx Co-authored-by: Hariom Balhara <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
5 files changed
+15
-9
No files matched your search
@@ -439,7 +439,7 @@ const loggedInViewerRouter = createProtectedRouter()
|
||||
})
|
||||
.query("bookings", {
|
||||
input: z.object({
|
||||
status: z.enum(["upcoming", "recurring", "past", "cancelled"]),
|
||||
status: z.enum(["upcoming", "recurring", "past", "cancelled", "unconfirmed"]),
|
||||
limit: z.number().min(1).max(100).nullish(),
|
||||
cursor: z.number().nullish(), // <-- "cursor" needs to exist when using useInfiniteQuery, but can be any type
|
||||
}),
|
||||
@@ -495,6 +495,10 @@ const loggedInViewerRouter = createProtectedRouter()
|
||||
{ status: { equals: BookingStatus.REJECTED } },
|
||||
],
|
||||
},
|
||||
unconfirmed: {
|
||||
endTime: { gte: new Date() },
|
||||
status: { equals: BookingStatus.PENDING },
|
||||
},
|
||||
};
|
||||
const bookingListingOrderby: Record<
|
||||
typeof bookingListingByStatus,
|
||||
@@ -504,6 +508,7 @@ const loggedInViewerRouter = createProtectedRouter()
|
||||
recurring: { startTime: "asc" },
|
||||
past: { startTime: "desc" },
|
||||
cancelled: { startTime: "desc" },
|
||||
unconfirmed: { startTime: "asc" },
|
||||
};
|
||||
const passedBookingsFilter = bookingListingFilters[bookingListingByStatus];
|
||||
const orderBy = bookingListingOrderby[bookingListingByStatus];
|
||||
|
||||
Reference in new issue
Block a user