feature/user-authentication #2

Merged
lasserh merged 31 commits from feature/user-authentication into main 2026-06-07 13:17:55 +02:00
Showing only changes of commit 3c33253cba - Show all commits

View file

@ -1,6 +1,7 @@
using GermanApp.Application.DTOs;
using GermanApp.Application.UseCases.Commands;
using GermanApp.Domain.Interfaces;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace GermanApp.Presentation.Endpoints;
@ -90,6 +91,7 @@ public static class LessonsEndpoints
var result = await handler.Handle(command, cancellationToken);
return Results.Created($"/api/lessons/{result.Id}", result);
})
.RequireAuthorization()
.WithName("CreateLesson")
.WithOpenApi(operation => new(operation)
{
@ -113,6 +115,7 @@ public static class LessonsEndpoints
return Results.Ok(existingLesson.ToDto());
})
.RequireAuthorization()
.WithName("UpdateLesson")
.WithOpenApi(operation => new(operation)
{
@ -130,6 +133,7 @@ public static class LessonsEndpoints
await repository.DeleteAsync(lesson);
return Results.NoContent();
})
.RequireAuthorization()
.WithName("DeleteLesson")
.WithOpenApi(operation => new(operation)
{