Skip to content

Show legacy PHOTO media as product images - #1503

Merged
wcole1-godaddy merged 1 commit into
godaddy:mainfrom
sbolinger-godaddy:accept-legacy-photo-media
Oct 14, 2026
Merged

wcole1-godaddy merged 1 commit into
godaddy:mainfrom
sbolinger-godaddy:accept-legacy-photo-media

Conversation

@sbolinger-godaddy

Copy link
Copy Markdown
Contributor

The catalog API schema documents media type as VIDEO, IMAGE or AUDIO, and notes that legacy objects may still have PHOTO. getImageUrls only accepted IMAGE, so stores with older media showed placeholders on catalog cards and product pages.

  • Accept PHOTO alongside IMAGE in getImageUrls in both gd-commerce-storefront and gd-commerce-server, the shared helpers.
  • Add a test covering legacy, current, non-image, and empty-URL media.

No changeset, as requested.

🤖 Generated with Claude Code

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>
@sbolinger-godaddy
sbolinger-godaddy requested a review from a team as a code owner October 13, 2026 22:38
@changeset-bot

changeset-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: af3cd99

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@wcole1-godaddy wcole1-godaddy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-server copy of getImageUrls has 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/react has the same type === 'IMAGE' check in components/storefront/product-card.tsx:119 and components/storefront/product-details.tsx:372, so the same stores would show no images there.

@wcole1-godaddy
wcole1-godaddy merged commit b6aa2c3 into godaddy:main Oct 14, 2026
3 checks passed
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.

3 participants