fix(contest): preserve untouched event_data fields when editing a contest#14529
Open
dylanjeffers wants to merge 1 commit into
Open
fix(contest): preserve untouched event_data fields when editing a contest#14529dylanjeffers wants to merge 1 commit into
dylanjeffers wants to merge 1 commit into
Conversation
…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>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Editing a remix contest (web
HostRemixContestModal, mobileHostRemixContestDrawer) rebuilteventDatafrom only the fields the form edits. The indexer's event-update handler replacesevent_datawholesale (COALESCE($2, event_data)with the full marshaled JSON), so saving an edit — e.g. extending a contest end date — silently wipedtitle,coverPhotoUrl,sourceTrackIds, and any other field the form doesn't own.Spread the existing
eventDatafirst so untouched fields survive the round-trip.PickWinnersPagealready 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
titleandsource_track_ids.Changes
packages/web/src/components/host-remix-contest-modal/HostRemixContestModal.tsx— spreadremixContest?.eventDatainto the submittedeventDatapackages/mobile/src/components/host-remix-contest-drawer/HostRemixContestDrawer.tsx— same for the edit branchTest plan
event_data.title/source_track_idsare unchanged viaGET /v1/events/entityundefinedstill removes it sinceJSON.stringifydrops it)undefinedis a no-op)🤖 Generated with Claude Code