Repository navigation
Show legacy PHOTO media as product images - #1503
Conversation
The catalog API still returns type PHOTO for media created before IMAGE, so products with older images showed no images. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
wcole1-godaddy
left a comment
There was a problem hiding this comment.
The fix is correct. I checked the catalog schema in catalog-api-v2, and Media.type is a String whose description says legacy objects may still have PHOTO. Typecheck, lint and tests pass for both packages.
Non-blocking notes:
- The
gd-commerce-servercopy ofgetImageUrlshas no runtime effect, because nothing in the server calls it and the package doesn't export it. Keeping it in sync is fine, and a follow-up could delete the unused helpers. - Without a changeset, the storefront fix only ships when another changeset bumps
gd-commerce-storefront, and it won't appear in the changelog. If you want it released or listed on its own, add a patch changeset for the storefront only. @godaddy/reacthas the sametype === 'IMAGE'check incomponents/storefront/product-card.tsx:119andcomponents/storefront/product-details.tsx:372, so the same stores would show no images there.
The catalog API schema documents media
typeasVIDEO,IMAGEorAUDIO, and notes that legacy objects may still havePHOTO.getImageUrlsonly acceptedIMAGE, so stores with older media showed placeholders on catalog cards and product pages.PHOTOalongsideIMAGEingetImageUrlsin bothgd-commerce-storefrontandgd-commerce-server, the shared helpers.No changeset, as requested.
🤖 Generated with Claude Code