| 1234567891011121314151617181920 |
- using MediatR;
- using Web.Api.Common;
- namespace Web.Api.Endpoints.News;
- internal sealed class Sources : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapGet("api/news/sources", async (
- ISender sender,
- CancellationToken ct
- ) =>
- {
- return ApiResponse.Ok(await sender.Send(new Application.Features.Api.News.GetSources.Query(), ct));
- })
- .WithTags("News")
- .AllowAnonymous();
- }
- }
|