Skip to content

fix: load product images through the API instead of the storefront origin - #9

Merged
PhilippTheServer merged 1 commit into
mainfrom
fix-product-image-urls
Sep 23, 2026
Merged

PhilippTheServer merged 1 commit into
mainfrom
fix-product-image-urls

Conversation

@PhilippTheServer

Copy link
Copy Markdown
Contributor

Closes #8

ApiService.items() and item() now resolve API-relative media paths (main_image, gallery) against apiUrl: /v1/items/{uuid}/image → /api/v1/items/{uuid}/image. Absolute URLs and missing images are untouched. The cart stores the items these calls return, so the shop grid, product page and cart are all fixed. README notes it.

Verification

npx ng test --watch=false (new src/app/core/api.service.spec.ts)

before the fix:
 × resolves API-relative images of a single item against the API
 × resolves images in a catalogue page and leaves absolute or missing ones alone
 Tests  2 failed | 23 passed (25)

after:
 Test Files  3 passed (3)
      Tests  25 passed (25)

Also checked in the browser against the local dev stack (storefront via docker compose, 40 items with uploaded images): images now render on /shop, /shop/:id and /cart; before, every one was broken.

🤖 Generated with Claude Code

…igin

Closes #8

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@PhilippTheServer
PhilippTheServer merged commit e74e6ef into main Sep 23, 2026
1 check passed
@PhilippTheServer
PhilippTheServer deleted the fix-product-image-urls branch September 23, 2026 23:10
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.

Product images never load in the storefront

1 participant