20 lines
521 B
C#
20 lines
521 B
C#
namespace Yes.Blog.Endpoints.Admins.Configurations
|
|
{
|
|
public class GetConfigurationEndpoint : ConfigurationEndpointScheme, IEndpoint
|
|
{
|
|
public void Map(IEndpointRouteBuilder app) => app.MapGet("/configuration", Handle).AllowAnonymous();
|
|
|
|
|
|
private async Task<IResult> Handle(
|
|
IMediator mediator,
|
|
IMapper mapper,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
var query = new GetConfigurationQuery();
|
|
var response = await mediator.Send(query, cancellationToken);
|
|
|
|
return Result.Ok(response);
|
|
}
|
|
}
|
|
}
|