Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@terwey
Copy link
Collaborator

@terwey terwey commented Nov 9, 2025

The settings view builds its wallet list from fetchVenues() in loadVenuesFromAPI, but the returned VenueRecord objects store the primary flag inside venue.flags.is_primary. The code was not extracting this value when populating the state, so downstream actions (edit, delete) that rely on venue.isPrimary would fail backend validation when no primary venue was marked.

This fix decodes flags.is_primary when mapping venues so the isPrimary property is correctly set on VenueWithAssignments objects, ensuring that exactly one primary venue is always preserved during updates.

Fixes the "invalid payload: no primary venue found" validation error when editing or deleting the primary wallet.

The settings view builds its wallet list from fetchVenues() in
loadVenuesFromAPI, but the returned VenueRecord objects store the
primary flag inside venue.flags.is_primary. The code was not extracting
this value when populating the state, so downstream actions (edit, delete)
that rely on venue.isPrimary would fail backend validation when no primary
venue was marked.

This fix decodes flags.is_primary when mapping venues so the isPrimary
property is correctly set on VenueWithAssignments objects, ensuring that
exactly one primary venue is always preserved during updates.

Fixes the "invalid payload: no primary venue found" validation error when
editing or deleting the primary wallet.
@terwey terwey marked this pull request as ready for review November 9, 2025 20:32
@terwey terwey merged commit 505a255 into ui/multi-venue Nov 9, 2025
2 checks passed
@terwey terwey deleted the claude/fix-primary-venue-flag-011CUxwgEqEVqUuf7yZnBxLd branch November 9, 2025 20:36
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