@page "/admin/inquiries"
@attribute [Authorize]
@using TaxBaik.Web.Services
@inject IInquiryBrowserClient InquiryClient
문의 관리
새 문의 등록
@if (isLoading)
{
}
else
{
}
@code {
[CascadingParameter]
private Task? AuthStateTask { get; set; }
private bool isLoading = true;
private IReadOnlyList allInquiries = [];
protected override async Task OnInitializedAsync()
{
if (AuthStateTask != null)
{
var authState = await AuthStateTask;
if (authState.User.Identity?.IsAuthenticated == true)
{
await LoadData();
}
}
}
private async Task LoadData()
{
isLoading = true;
try
{
var (items, _) = await InquiryClient.GetPagedAsync(1, 200);
allInquiries = items.ToList();
}
catch
{
allInquiries = [];
}
finally
{
isLoading = false;
}
}
}