Skip to content

Commit 6ab03dd

Browse files
fixed typed results
1 parent ee1ced7 commit 6ab03dd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/services/api/CodeBreaker.APIs/Endpoints/GameEndpoints.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using CodeBreaker.Data.Models;
44
using CodeBreaker.Shared.Api;
55
using CodeBreaker.Shared.Exceptions;
6+
7+
using Microsoft.AspNetCore.Http.HttpResults;
68
using Microsoft.AspNetCore.Mvc;
79

810
namespace CodeBreaker.APIs.Endpoints;
@@ -33,7 +35,7 @@ [FromServices] IGameService gameService
3335
});
3436

3537
// Get game by id
36-
group.MapGet("/{gameId:guid}", async Task<IResult> (
38+
group.MapGet("/{gameId:guid}", async Task<Results<Ok<GetGameResponse>, NotFound>> (
3739
[FromRoute] Guid gameId,
3840
[FromServices] IGameService gameService
3941
) =>
@@ -70,7 +72,7 @@ [FromServices] IGameService gameService
7072
});
7173

7274
// Create move for game
73-
group.MapPost("/{gameId:guid}/moves", async Task<IResult> (
75+
group.MapPost("/{gameId:guid}/moves", async Task<Results<Ok<CreateMoveResponse>, NotFound, BadRequest<string>>>(
7476
[FromRoute] Guid gameId,
7577
[FromBody] CreateMoveRequest req,
7678
[FromServices] IMoveService moveService) =>

0 commit comments

Comments
 (0)