diff --git a/HackathonPreparing/HackathonPreparing.ApiService/Features/WeatherForecastFeature/WeatherForecastEndpointsExtensions.cs b/HackathonPreparing/HackathonPreparing.ApiService/Features/WeatherForecastFeature/WeatherForecastEndpointsExtensions.cs index 4892a42..a560a13 100644 --- a/HackathonPreparing/HackathonPreparing.ApiService/Features/WeatherForecastFeature/WeatherForecastEndpointsExtensions.cs +++ b/HackathonPreparing/HackathonPreparing.ApiService/Features/WeatherForecastFeature/WeatherForecastEndpointsExtensions.cs @@ -10,7 +10,7 @@ public static class WeatherForecastEndpointsExtensions { var group = app.MapGroup("weatherforecast"); group.MapGet(string.Empty, async (WeatherForecastContext db) => await db.Forecasts.ToListAsync()); - group.MapDelete("{id}", [Authorize(Roles="moderator")]async (WeatherForecastContext db, int id) => + group.MapDelete("{id}", [Authorize]async (WeatherForecastContext db, int id) => { var forecast = await db.Forecasts.FindAsync(id); if (forecast == null) @@ -23,14 +23,14 @@ public static class WeatherForecastEndpointsExtensions return Results.NoContent(); }); - group.MapPost(string.Empty, [Authorize(Roles="moderator")] async (WeatherForecastContext db, WeatherForecast forecast) => + group.MapPost(string.Empty, [Authorize] async (WeatherForecastContext db, WeatherForecast forecast) => { db.Forecasts.Add(forecast); await db.SaveChangesAsync(); return Results.Created($"/weatherforecast/{forecast.Id}", forecast); }); - group.MapPut("{id}", [Authorize(Roles="moderator")] async (WeatherForecastContext db, int id, WeatherForecast forecast) => + group.MapPut("{id}", [Authorize] async (WeatherForecastContext db, int id, WeatherForecast forecast) => { if (id != forecast.Id) {