Added user management endpoints

This commit is contained in:
2026-10-10 10:12:13 +02:00
parent 1ebd83a2f4
commit 2ee7a49122
19 changed files with 688 additions and 40 deletions
@@ -17,7 +17,7 @@ public sealed class GetUserEndpoint : IEndpoint
await service.GetUserAsync(userId, cancellationToken) switch
{
{ IsSuccess: true, Value: var user } => Results.Ok(user),
var r when r.HasError<NotFoundError>() => Results.NotFound(),
var r when r.HasError<NotFoundError>() => Results.NotFound(r.Errors.ToProblems()),
var r => Results.InternalServerError(r.Errors.ToProblems())
})
.WithDescription("Gets the metadata of a single user.")
@@ -25,8 +25,8 @@ public sealed class GetUserEndpoint : IEndpoint
.WithName(typeof(GetUserEndpoint).ToEndpointName())
.MapToApiVersion(new ApiVersion(1))
.Produces<User>(StatusCodes.Status200OK)
.Produces(StatusCodes.Status404NotFound)
.Produces(StatusCodes.Status401Unauthorized)
.Produces<Problems>(StatusCodes.Status404NotFound)
.Produces<Problems>(StatusCodes.Status500InternalServerError)
.WithTags(EndpointTags.Users)
.CacheOutput();