Skip to content

Commit

Permalink
Make full pickup events not show on cart page
Browse files Browse the repository at this point in the history
  • Loading branch information
WishingWell13 committed Apr 16, 2024
1 parent 7ea90e6 commit ec1b24f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/store/cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ const getServerSidePropsFunc: GetServerSideProps = async ({ req, res }) => {

const savedCartPromise = CartService.getCart({ req, res });
const pickupEventsPromise = getFutureOrderPickupEvents(AUTH_TOKEN).then(events =>
events.filter(event => event.status !== 'CANCELLED')
events
.filter(event => event.status !== 'CANCELLED')
.filter(
event => (event.orders?.length ?? 0) <= (event?.orderLimit ?? Number.MAX_SAFE_INTEGER)
)
);
const userPromise = getCurrentUserAndRefreshCookie(AUTH_TOKEN, { req, res });

Expand Down

0 comments on commit ec1b24f

Please sign in to comment.