Skip to content

Commit

Permalink
Add query includeDeleted query param.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTedder committed Oct 28, 2024
1 parent 42e3357 commit 98e720d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions LeaderboardBackend/Controllers/LeaderboardsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public async Task<ActionResult<LeaderboardViewModel>> GetLeaderboardBySlug([From
[HttpGet("api/leaderboards")]
[SwaggerOperation("Gets all leaderboards.", OperationId = "listLeaderboards")]
[SwaggerResponse(200)]
public async Task<ActionResult<List<LeaderboardViewModel>>> GetLeaderboards()
public async Task<ActionResult<List<LeaderboardViewModel>>> GetLeaderboards([FromQuery] bool includeDeleted = false)
{
// TODO: Paginate.

List<Leaderboard> result = await leaderboardService.ListLeaderboards();
List<Leaderboard> result = await leaderboardService.ListLeaderboards(includeDeleted);
return Ok(result.Select(LeaderboardViewModel.MapFrom));
}

Expand Down
10 changes: 10 additions & 0 deletions LeaderboardBackend/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,16 @@
],
"summary": "Gets all leaderboards.",
"operationId": "listLeaderboards",
"parameters": [
{
"name": "includeDeleted",
"in": "query",
"schema": {
"type": "boolean",
"default": false
}
}
],
"responses": {
"400": {
"description": "Bad Request",
Expand Down

0 comments on commit 98e720d

Please sign in to comment.