Repository navigation
Conversation
Signed-off-by: krish858 <unknowmortal57@gmail.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
hi @Ri1tik , do these changes looks good ? |
Addressed Issues:
Fixes #807
Screenshots/Recordings:
Before –
GET /teams/availablereturns the invite code, captain email and every member's email to any logged-in user:After –
GET /teams/availablereturns only public fields (nocode,captainEmailoremail):After – Available Teams card shows the team leader's name instead of their email:
After –
GET /teams/<another team's id>as a non-member returns 403:Additional Notes:
Problem:
GET /teams/availablesent every open team in full (invite code, captain email, all members' emails) to any logged-in user, andGET /teams/:idreturned the full team for any ID without checking membership.Backend
models/team.go: addedTeamSummary/TeamSummaryMember(id, name, captainId, captainName, members with userId/displayName/avatarUrl/elo, maxSize, averageElo — no code, no emails), plusTeam.Summary()andTeam.HasMember().controllers/team_controller.go:GetAvailableTeamsnow returns[]TeamSummary.GetTeamreturns 403 to non-members; members still get the full team.Frontend
services/teamService.ts: addedTeamSummarytypes;getAvailableTeams()returnsTeamSummary[].Pages/TeamBuilder.tsx: the Available Teams card shows the team leader's name instead of their email.Not affected: your own teams (
/teams/user/teamsstill includes the invite code for members), join by ID, join by code, member profiles and team matchmaking.GET /teams/:idhas no callers in the frontend or backend.How to verify
/teams/availablecontains nocode,captainEmailoremail.GET /teams/<A's team id>→ 403; as A → full team.Checks run:
go build ./...,go vet ./...,go test ./...,npm test,npm run buildall pass.npm run lintreports 9 errors inTeamBuilder.tsxthat already exist onmain; this PR adds none.AI Usage Disclosure:
I have used the following AI models and tools: Claude Opus 5.5 (Anthropic), used to review the affected code paths, draft the backend/frontend changes. I reviewed every change, ran it locally in Docker, and verified the endpoint responses and UI manually.
Checklist
Summary by CodeRabbit
New Features
Bug Fixes