Skip to content

Commit

Permalink
Add Type to CreateCategoryRequest.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTedder committed Jul 22, 2024
1 parent deecd7c commit c9f6d50
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion LeaderboardBackend.Test/Categories.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Net;
using System.Threading.Tasks;
using LeaderboardBackend.Models;
using LeaderboardBackend.Models.Entities;
using LeaderboardBackend.Models.Requests;
using LeaderboardBackend.Models.ViewModels;
Expand Down Expand Up @@ -74,7 +75,8 @@ public static async Task CreateCategory_GetCategory_OK()
Slug = "1_player",
LeaderboardId = createdLeaderboard.Id,
Info = null,
SortDirection = SortDirection.Ascending
SortDirection = SortDirection.Ascending,
Type = RunType.Time
},
Jwt = _jwt
}
Expand Down
4 changes: 3 additions & 1 deletion LeaderboardBackend.Test/Runs.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
using LeaderboardBackend.Models;
using LeaderboardBackend.Models.Entities;
using LeaderboardBackend.Models.Requests;
using LeaderboardBackend.Models.ViewModels;
Expand Down Expand Up @@ -57,7 +58,8 @@ public async Task SetUp()
Slug = "120_stars",
LeaderboardId = createdLeaderboard.Id,
Info = null,
SortDirection = SortDirection.Ascending
SortDirection = SortDirection.Ascending,
Type = RunType.Time
},
Jwt = _jwt,
}
Expand Down
3 changes: 3 additions & 0 deletions LeaderboardBackend/Models/Requests/CategoryRequests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ public record CreateCategoryRequest

/// <inheritdoc cref="Category.SortDirection" />
public required SortDirection SortDirection { get; set; }

/// <inheritdoc cref="Category.Type" />
public required RunType Type { get; set; }
}
6 changes: 5 additions & 1 deletion LeaderboardBackend/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,8 @@
"leaderboardId",
"name",
"slug",
"sortDirection"
"sortDirection",
"type"
],
"type": "object",
"properties": {
Expand All @@ -1003,6 +1004,9 @@
},
"sortDirection": {
"$ref": "#/components/schemas/SortDirection"
},
"type": {
"$ref": "#/components/schemas/RunType"
}
},
"additionalProperties": false,
Expand Down

0 comments on commit c9f6d50

Please sign in to comment.