using Microsoft.AspNetCore.Mvc.RazorPages;
using Application.Abstractions.Messaging;

namespace Admin.Pages.Director.User
{
    public class IndexModel(IMediator mediator) : PageModel
    {
        public int Total { get; set; } = 0;
        public List<GetUsers.Response> List { get; set; } = [];

        public async Task OnGetAsync(CancellationToken ct)
        {
            List = await mediator.Send(new GetUsers.Query(), ct);
            Total = List.Count;
        }
    }
}