Added user management endpoints
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user