Skip to content

Conversation

@jackattack-4
Copy link
Contributor

@jackattack-4 jackattack-4 commented Jan 5, 2026

responds with { "TEAM_DOES_NOT_EXIST" } or { "NO_DATA_FOR_TEAM" }

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds explicit error handling for team lookup endpoints to distinguish between non-existent teams and teams with no data. When a team doesn't exist in the database, the handlers return "TEAM_DOES_NOT_EXIST", and when a team exists but has no associated data, they return "NO_DATA_FOR_TEAM" (note: the actual response is the error string, not an object containing it, due to how the analysisHandler processes error responses).

Key Changes:

  • Added team existence validation using Prisma's findUnique query before processing data
  • Added no-data detection logic that checks if any relevant data exists for the team
  • Applied changes consistently across three team lookup handlers

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/handler/analysis/teamLookUp/getNotes.ts Added team existence check and empty notes validation; includes an unused import that should be removed
src/handler/analysis/teamLookUp/categoryMetrics.ts Added team existence check and validates whether any metric has data; contains potential issue with treating 0 values as "no data"
src/handler/analysis/teamLookUp/breakdownMetrics.ts Added team existence check and validates whether any breakdown metric has valid data

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jackattack-4 jackattack-4 merged commit d8594da into main Jan 9, 2026
3 checks passed
@jackattack-4 jackattack-4 deleted the jackshim415/lvt-51-specific-state-in-team-lookup-for-when-theres-no-data-or-a-team-doesnt-exist branch January 9, 2026 00:47
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