Skip to content

fix(contest): preserve untouched event_data fields when editing a contest#14529

Open
dylanjeffers wants to merge 1 commit into
mainfrom
fix/contest-edit-preserve-event-data
Open

fix(contest): preserve untouched event_data fields when editing a contest#14529
dylanjeffers wants to merge 1 commit into
mainfrom
fix/contest-edit-preserve-event-data

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

What

Editing a remix contest (web HostRemixContestModal, mobile HostRemixContestDrawer) rebuilt eventData from only the fields the form edits. The indexer's event-update handler replaces event_data wholesale (COALESCE($2, event_data) with the full marshaled JSON), so saving an edit — e.g. extending a contest end date — silently wiped title, coverPhotoUrl, sourceTrackIds, and any other field the form doesn't own.

Spread the existing eventData first so untouched fields survive the round-trip. PickWinnersPage already follows this pattern.

Why now

BURKO's Labyrinth contest needs its end date extended (Jul 20 → Aug 3). Without this fix, doing that through the UI destroys the contest's title and source_track_ids.

Changes

  • packages/web/src/components/host-remix-contest-modal/HostRemixContestModal.tsx — spread remixContest?.eventData into the submitted eventData
  • packages/mobile/src/components/host-remix-contest-drawer/HostRemixContestDrawer.tsx — same for the edit branch

Test plan

  • Edit an existing contest's end date on web; confirm event_data.title / source_track_ids are unchanged via GET /v1/events/entity
  • Same on mobile, including clearing the video URL (an explicit undefined still removes it since JSON.stringify drops it)
  • Create-contest flow unaffected (spread of undefined is a no-op)

🤖 Generated with Claude Code

…test

The host-remix-contest edit forms (web modal and mobile drawer) rebuilt
event_data from only the fields they edit (description, prizeInfo,
winners, and videoUrl on mobile). The indexer replaces event_data
wholesale on update, so saving an edit — e.g. extending the contest end
date — silently wiped title, coverPhotoUrl, sourceTrackIds, and any
other field the form doesn't own. Spread the existing eventData first so
untouched fields survive the round-trip. PickWinnersPage already does
this correctly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4c53858

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant