Skip to content

fix(orders): let customers change pickup slot on PRINTED orders (frontend)#101

Merged
choden-dev merged 1 commit into
mainfrom
fix/frontend-change-timeslot-printed
Jul 17, 2026
Merged

fix(orders): let customers change pickup slot on PRINTED orders (frontend)#101
choden-dev merged 1 commit into
mainfrom
fix/frontend-change-timeslot-printed

Conversation

@choden-dev

Copy link
Copy Markdown
Owner

Problem

PR #100 updated the POST /api/shop/:orderId/select-timeslot endpoint to accept PRINTED orders, so the backend now supports customers changing their pickup slot after an admin has printed the order.

However, the customer-facing frontend never surfaced a way to trigger this, so in practice only admins could change the timeslot of a printed order. Two frontend touchpoints gated on PAID/AWAITING_PICKUP only:

  1. pages/my-orders.tsx — the Change Pickup button in renderOrderAction was only rendered for PAID and AWAITING_PICKUP orders. A customer with a PRINTED order saw no action button.
  2. components/ordercontainer/OrderContainer.tsx — navigating via ?pickupFor=<id> only forced the PICKUP step for PAID/AWAITING_PICKUP. For a PRINTED order, statusToStep() returned COMPLETE, dropping the user on the confirmation screen instead of the timeslot picker.

Fix

  • my-orders.tsx: show the Change Pickup button for PRINTED orders too.
  • OrderContainer.tsx: force the PICKUP step for PRINTED orders when arriving via ?pickupFor=.

The PICKUP step in OrderSteps.tsx already renders TimeslotSelector unconditionally (and OrderSteps already allows staying on the PICKUP step for PRINTED), so no further changes were needed once the step is reached. The COMPLETE step's existing Change Pickup button also now works end-to-end for printed orders.

Testing

  • biome check passes on both changed files.
  • tsc --noEmit passes with no errors.
  • Pre-commit and pre-push hooks passed.

…tend)

PR #100 allowed the select-timeslot endpoint to accept PRINTED orders, but
the customer-facing frontend never surfaced a way to trigger it:

- my-orders.tsx: 'Change Pickup' action was only shown for PAID and
  AWAITING_PICKUP orders, so a customer with a PRINTED order had no button.
- OrderContainer.tsx: navigating via ?pickupFor= only forced the PICKUP
  step for PAID/AWAITING_PICKUP; PRINTED orders fell through to
  statusToStep() which sends them to COMPLETE, hiding the timeslot picker.

Both now include PRINTED. The PICKUP step already renders TimeslotSelector
unconditionally, so the change UI works once the step is reached.
@choden-dev
choden-dev merged commit d3c05d3 into main Jul 17, 2026
4 checks passed
@choden-dev
choden-dev deleted the fix/frontend-change-timeslot-printed branch July 17, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant