Skip to content

Wrap /admin/errors/competitions-without-plays response in DTO#25

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/wrap-admin-errors-response-another-one
Draft

Wrap /admin/errors/competitions-without-plays response in DTO#25
Copilot wants to merge 2 commits intomainfrom
copilot/wrap-admin-errors-response-another-one

Conversation

Copy link
Contributor

Copilot AI commented Nov 24, 2025

Endpoint returns naked collection instead of wrapped response object per API standardization effort.

Changes

  • New DTO: CompetitionsWithoutPlaysResponse with Items property wrapping List<CompetitionWithoutPlaysDto>
  • Service layer: Updated IAdminService.GetCompetitionsWithoutPlays() return type from Result<List<T>> to Result<CompetitionsWithoutPlaysResponse>
  • Controller: Changed endpoint return type to ActionResult<CompetitionsWithoutPlaysResponse>

Response Format

Before:

[
  { "contestId": "...", "playCount": 0, ... }
]

After:

{
  "items": [
    { "contestId": "...", "playCount": 0, ... }
  ]
}

Frontend already handles both formats via optional chaining: res.data?.items ?? res.data

Original prompt

This section details on the original issue you should resolve

<issue_title>Wrap /admin/errors/competitions-without-plays response</issue_title>
<issue_description>Location: AdminController.cs:125

Current: Returns naked collection
Target: Return wrapped response object

Acceptance Criteria:

  • Create response DTO
  • Update controller
  • Update frontend if needed
  • Update tests
  • Verify Swagger

See docs/API-WRAPPER-REFACTORING.md</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 24, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: jrandallsexton <1276830+jrandallsexton@users.noreply.github.com>
Copilot AI changed the title [WIP] Wrap /admin/errors/competitions-without-plays response Wrap /admin/errors/competitions-without-plays response in DTO Nov 24, 2025
Copilot AI requested a review from jrandallsexton November 24, 2025 01:50
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.

Wrap /admin/errors/competitions-without-plays response

2 participants