brackt/app/routes/leagues
Chris Parsons 9d1765d8a4
Auto-name teams on claim and harden owner-assignment logic (#163)
* Auto-name teams on claim and harden owner-assignment logic

- Add claimTeam() model function that atomically sets ownerId + name in
  a single DB write, replacing the previous two-step assignTeamOwner +
  renameTeam pattern that could leave partial state on failure
- Rename team to "Team <username>" (fallback: displayName, then "Member")
  when a user joins via invite link or an admin assigns a team owner
- Fetch the user record before claiming the team in both paths so we fail
  fast with a clear error rather than silently skipping the rename
- Guard against assigning an already-owned team in the admin settings
  action (closes #107, closes #76)
- Show owner username below team name in draft order settings UI;
  teams with an owner but no matching user record display "Unknown"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fixing dropdown for admins

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 00:53:40 -07:00
..
__tests__ Partial bracket scoring, code review fixes, and double-chance logic (#156) 2026-03-17 10:50:30 -07:00
$leagueId.draft-board.$seasonId.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
$leagueId.draft.$seasonId.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
$leagueId.server.ts Add event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -07:00
$leagueId.settings.tsx Auto-name teams on claim and harden owner-assignment logic (#163) 2026-03-18 00:53:40 -07:00
$leagueId.sports-seasons.$sportsSeasonId.server.ts Fix partial bracket scoring, rank labels, and Discord notification bugs (#158) 2026-03-17 12:34:10 -07:00
$leagueId.sports-seasons.$sportsSeasonId.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
$leagueId.standings.$seasonId.teams.$teamId.tsx Simplify team breakdown page layout and fix code quality issues (#155) 2026-03-17 09:20:41 -07:00
$leagueId.standings.$seasonId.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
$leagueId.tsx Display upcoming matches (#141) 2026-03-12 10:12:38 -07:00
new.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00