Add phase requirement filter for vote/results endpoints
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using GameList.Data;
|
||||
using GameList.Domain;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using GameList.Infrastructure;
|
||||
|
||||
namespace GameList.Endpoints;
|
||||
|
||||
@@ -8,7 +9,9 @@ public static class ResultsEndpoints
|
||||
{
|
||||
public static void MapResultsEndpoints(this IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.MapGroup("/api/results").RequireAuthorization();
|
||||
var group = app.MapGroup("/api/results")
|
||||
.RequireAuthorization()
|
||||
.AddEndpointFilter(new PhaseRequirementFilter(Phase.Results));
|
||||
|
||||
group.MapGet(
|
||||
"/",
|
||||
|
||||
Reference in New Issue
Block a user