1
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
namespace Yes.Blog.Endpoints.Admins.Comments
|
||||
{
|
||||
public class GetLatestCommentsEndpoint : AdminEndpointScheme, IEndpoint
|
||||
{
|
||||
public void Map(IEndpointRouteBuilder app) => app.MapGet("/comments/Latest", Handle);
|
||||
|
||||
|
||||
|
||||
private async Task<IResult> Handle(
|
||||
IMediator mediator,
|
||||
IMapper mapper,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var query = new GetLatestCommentsQuery();
|
||||
var response = await mediator.Send(query, cancellationToken);
|
||||
|
||||
return Result.Ok(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user