Applying feedback from a merged PR (#4887)
This commit is contained in:
@@ -53,6 +53,16 @@ function BookingListItem(booking: BookingItemProps) {
|
||||
},
|
||||
});
|
||||
|
||||
const isUpcoming = new Date(booking.endTime) >= new Date();
|
||||
const isPast = new Date(booking.endTime) < new Date();
|
||||
const isCancelled = booking.status === BookingStatus.CANCELLED;
|
||||
const isConfirmed = booking.status === BookingStatus.ACCEPTED;
|
||||
const isRejected = booking.status === BookingStatus.REJECTED;
|
||||
const isPending = booking.status === BookingStatus.PENDING;
|
||||
const isRecurring = booking.recurringEventId !== null;
|
||||
const isTabRecurring = booking.listingStatus === "recurring";
|
||||
const isTabUnconfirmed = booking.listingStatus === "unconfirmed";
|
||||
|
||||
const bookingConfirm = async (confirm: boolean) => {
|
||||
let body = {
|
||||
bookingId: booking.id,
|
||||
@@ -69,16 +79,6 @@ function BookingListItem(booking: BookingItemProps) {
|
||||
mutation.mutate(body);
|
||||
};
|
||||
|
||||
const isUpcoming = new Date(booking.endTime) >= new Date();
|
||||
const isPast = new Date(booking.endTime) < new Date();
|
||||
const isCancelled = booking.status === BookingStatus.CANCELLED;
|
||||
const isConfirmed = booking.status === BookingStatus.ACCEPTED;
|
||||
const isRejected = booking.status === BookingStatus.REJECTED;
|
||||
const isPending = booking.status === BookingStatus.PENDING;
|
||||
const isRecurring = booking.recurringEventId !== null;
|
||||
const isTabRecurring = booking.listingStatus === "recurring";
|
||||
const isTabUnconfirmed = booking.listingStatus === "unconfirmed";
|
||||
|
||||
const pendingActions: ActionType[] = [
|
||||
{
|
||||
id: "reject",
|
||||
|
||||
@@ -454,20 +454,12 @@ const loggedInViewerRouter = createProtectedRouter()
|
||||
// handled separately for each occurrence
|
||||
OR: [
|
||||
{
|
||||
AND: [
|
||||
{ NOT: { recurringEventId: { equals: null } } },
|
||||
{
|
||||
status: {
|
||||
notIn: [BookingStatus.PENDING, BookingStatus.CANCELLED, BookingStatus.REJECTED],
|
||||
},
|
||||
},
|
||||
],
|
||||
recurringEventId: { not: null },
|
||||
status: { notIn: [BookingStatus.PENDING, BookingStatus.CANCELLED, BookingStatus.REJECTED] },
|
||||
},
|
||||
{
|
||||
AND: [
|
||||
{ recurringEventId: { equals: null } },
|
||||
{ status: { notIn: [BookingStatus.CANCELLED, BookingStatus.REJECTED] } },
|
||||
],
|
||||
recurringEventId: { equals: null },
|
||||
status: { notIn: [BookingStatus.CANCELLED, BookingStatus.REJECTED] },
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -495,12 +487,8 @@ const loggedInViewerRouter = createProtectedRouter()
|
||||
endTime: { gte: new Date() },
|
||||
OR: [
|
||||
{
|
||||
AND: [
|
||||
{ NOT: { recurringEventId: { equals: null } } },
|
||||
{
|
||||
status: { equals: BookingStatus.PENDING },
|
||||
},
|
||||
],
|
||||
recurringEventId: { not: null },
|
||||
status: { equals: BookingStatus.PENDING },
|
||||
},
|
||||
{
|
||||
status: { equals: BookingStatus.PENDING },
|
||||
|
||||
Reference in New Issue
Block a user