namespace Netina.Api.Controllers;

public class WebSiteController:ICarterModule
{
    public void AddRoutes(IEndpointRouteBuilder app)
    {
        var group = app.NewVersionedApi("WebSite").MapGroup("api/website");

        group.MapGet("/navbar", GetNavBarItemsAsync)
            .WithDisplayName("Get NavBar Items")
            .HasApiVersion(1.0);
    }

    private async Task<IResult> GetNavBarItemsAsync([FromServices] IMediator mediator, CancellationToken cancellationToken)
        => TypedResults.Ok(await mediator.Send(new GetWebSiteNavBarCommand(),cancellationToken));
}