Skip to content

fix(storefront): repair the review and cart-item chains - #30

Merged
roncodes merged 1 commit into
mainfrom
fix/storefront-review-and-cart-chain
Aug 11, 2026
Merged

roncodes merged 1 commit into
mainfrom
fix/storefront-review-and-cart-chain

Conversation

@roncodes

Copy link
Copy Markdown
Member

Four Storefront requests, two chains.

Reviews

Create a review sent no subject. ReviewController resolves it with Utils::resolveSubject(), whose parameter is a non-nullable string, so the request threw a TypeError as a 500 — before the controller's own if (!$subject) guard could run. It now reviews {{product_id}}, which Create Product already captures. (The API side is fixed separately so a missing subject is a 422 rather than a crash: fleetbase/storefront@b23c029.)

Retrieve a Store review and Delete a Review addressed /reviews/{id}. Single braces are not a Postman variable, so both requested the literal %7Bid%7D and answered "Review resource not found." Nothing captured a review id anywhere in the collection, so Create a review now sets {{review_id}} and both use it.

Cart

Add Item to Cart addressed /carts/{id}/{product_id} — the same single-brace problem in two places. Both are now variables the run already has: {{cart_id}} from Retrieve or Create Cart, {{product_id}} from Create Product. This is the head of the cart chain, so Update item in Cart and Remove item from cart currently fail behind it with "Invalid cart item provided to cart!".

Its body also sent "scheduled_at": "scheduled_at_value_here" and "store_location": "store_location_value_here" — placeholder text, which the endpoint reads as a date and a store location id and rejects. Both fields are optional, so they are dropped rather than faked. The request still documents the required shape; inventing a schedule or a location id would make the example wrong for readers.

🤖 Generated with Claude Code

Create a review sent no subject.
  ReviewController resolves it with Utils::resolveSubject(), whose parameter is a
  non-nullable string, so the request threw a TypeError as a 500. It now reviews
  {{product_id}}, which Create Product already captures. The API side is fixed
  separately so a missing subject is a 422 rather than a crash.

Retrieve a Store review and Delete a Review addressed /reviews/{id}.
  Single braces are not a Postman variable, so both requested the literal string
  "%7Bid%7D" and answered "Review resource not found." Nothing captured a review
  id at all, so Create a review now sets {{review_id}} and both use it.

Add Item to Cart addressed /carts/{id}/{product_id}.
  Same single-brace problem in two places. Both are now the variables the run
  already has — {{cart_id}} from Retrieve or Create Cart, {{product_id}} from
  Create Product.

  Its body also sent "scheduled_at": "scheduled_at_value_here" and
  "store_location": "store_location_value_here". Those are placeholder text, not
  values; the endpoint treats them as a date and a store location id and rejects
  them. Both fields are optional, so they are dropped rather than faked — the
  request documents the required shape without inventing a schedule.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@roncodes
roncodes merged commit 4379c52 into main Aug 11, 2026
1 check passed
@roncodes
roncodes deleted the fix/storefront-review-and-cart-chain branch August 11, 2026 10:46
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