From 7d4edb6caa6a4fb568f403dd1e8d864c4111b655 Mon Sep 17 00:00:00 2001 From: Sergey Karmanov Date: Fri, 21 Jun 2024 13:26:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BE=D1=82=D0=BA=D0=BB=D1=8E=D1=87=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BC=D0=BE=D0=B4=D0=B5=D1=80=D0=B0=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WeatherForecastEndpointsExtensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) {