Applying feedback from a merged PR (#4887)
This commit is contained in:
1 parent
41c1e960f8
commit
0098591a56
2 files changed
+16
-28
No files matched your search
@@ -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) => {
|
const bookingConfirm = async (confirm: boolean) => {
|
||||||
let body = {
|
let body = {
|
||||||
bookingId: booking.id,
|
bookingId: booking.id,
|
||||||
@@ -69,16 +79,6 @@ function BookingListItem(booking: BookingItemProps) {
|
|||||||
mutation.mutate(body);
|
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[] = [
|
const pendingActions: ActionType[] = [
|
||||||
{
|
{
|
||||||
id: "reject",
|
id: "reject",
|
||||||
|
|||||||
@@ -454,20 +454,12 @@ const loggedInViewerRouter = createProtectedRouter()
|
|||||||
// handled separately for each occurrence
|
// handled separately for each occurrence
|
||||||
OR: [
|
OR: [
|
||||||
{
|
{
|
||||||
AND: [
|
recurringEventId: { not: null },
|
||||||
{ NOT: { recurringEventId: { equals: null } } },
|
status: { notIn: [BookingStatus.PENDING, BookingStatus.CANCELLED, BookingStatus.REJECTED] },
|
||||||
{
|
|
||||||
status: {
|
|
||||||
notIn: [BookingStatus.PENDING, BookingStatus.CANCELLED, BookingStatus.REJECTED],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
AND: [
|
recurringEventId: { equals: null },
|
||||||
{ recurringEventId: { equals: null } },
|
status: { notIn: [BookingStatus.CANCELLED, BookingStatus.REJECTED] },
|
||||||
{ status: { notIn: [BookingStatus.CANCELLED, BookingStatus.REJECTED] } },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -495,12 +487,8 @@ const loggedInViewerRouter = createProtectedRouter()
|
|||||||
endTime: { gte: new Date() },
|
endTime: { gte: new Date() },
|
||||||
OR: [
|
OR: [
|
||||||
{
|
{
|
||||||
AND: [
|
recurringEventId: { not: null },
|
||||||
{ NOT: { recurringEventId: { equals: null } } },
|
status: { equals: BookingStatus.PENDING },
|
||||||
{
|
|
||||||
status: { equals: BookingStatus.PENDING },
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
status: { equals: BookingStatus.PENDING },
|
status: { equals: BookingStatus.PENDING },
|
||||||
|
|||||||
Reference in new issue
Block a user