This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using TaxBaik.Application.Services;
|
||||
using TaxBaik.Web.Services;
|
||||
|
||||
namespace TaxBaik.Web.Pages.Admin.Customers;
|
||||
|
||||
[Authorize(AuthenticationSchemes = AdminAuthDefaults.Scheme)]
|
||||
public class IndexModel(ClientService clientService) : PageModel
|
||||
{
|
||||
public List<TaxBaik.Domain.Entities.Client> Items { get; private set; } = [];
|
||||
|
||||
public string? Search { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public int PageSize { get; set; } = 10;
|
||||
|
||||
public async Task OnGetAsync(string? search, string? status, int pageSize = 10, CancellationToken ct = default)
|
||||
{
|
||||
Search = search;
|
||||
Status = status;
|
||||
PageSize = pageSize;
|
||||
|
||||
var (items, _) = await clientService.GetPagedAsync(1, pageSize, status, search, ct);
|
||||
Items = items.ToList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user