brackt/app/routes
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
..
api Grant sitewide admins commissioner-level access in leagues (#162) 2026-03-18 00:41:56 -07:00
leagues Auto-name teams on claim and harden owner-assignment logic (#163) 2026-03-18 00:53:40 -07:00
teams feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin._index.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.data-sync.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.participants.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.events.$eventId.bracket.server.ts Fix partial bracket scoring, rank labels, and Discord notification bugs (#158) 2026-03-17 12:34:10 -07:00
admin.sports-seasons.$id.events.$eventId.bracket.tsx Fix partial bracket scoring, rank labels, and Discord notification bugs (#158) 2026-03-17 12:34:10 -07:00
admin.sports-seasons.$id.events.$eventId.server.ts Add event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -07:00
admin.sports-seasons.$id.events.$eventId.tsx Fix event date timezone bugs (UTC rollover + same-day status) (#148) 2026-03-15 12:28:39 -07:00
admin.sports-seasons.$id.events.server.ts Add event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -07:00
admin.sports-seasons.$id.events.tsx Fix event date timezone bugs (UTC rollover + same-day status) (#148) 2026-03-15 12:28:39 -07:00
admin.sports-seasons.$id.expected-values.server.ts Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
admin.sports-seasons.$id.expected-values.tsx Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
admin.sports-seasons.$id.futures-odds.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.participants.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.simulate.tsx Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
admin.sports-seasons.$id.standings.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.$id.tsx Add Discord usernames, fix calculateTeamScore partial-score bug, and add admin re-score action (#160) 2026-03-17 14:34:09 -07:00
admin.sports-seasons.new.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports-seasons.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports.$id.tsx Fix NBA simulator missing from dropdown and enum not applied to prod DB 2026-03-16 22:18:50 -07:00
admin.sports.new.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.sports.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.standings-snapshots.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.templates.$id.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.templates.new.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.templates.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
admin.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
api.admin.export-sports-data.ts feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
home.tsx Add event_starts_at timestamp to scoring events for sub-day ordering (#146) 2026-03-15 10:22:42 -07:00
how-to-play.tsx Add rules page, rewrite how-to-play, and fix scoring display (#20) 2026-02-21 21:58:51 -08:00
i.$inviteCode.tsx Auto-name teams on claim and harden owner-assignment logic (#163) 2026-03-18 00:53:40 -07:00
rules.tsx Add rules page, rewrite how-to-play, and fix scoring display (#20) 2026-02-21 21:58:51 -08:00
test-socket.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00
user-profile.tsx feat: add meta title to all route pages (#109) 2026-03-10 12:10:52 -07:00