[CHANGE] Channel & Account list to view models

This commit is contained in:
max
2025-09-22 17:12:42 +02:00
parent 646e0a814a
commit 2c125c24ae
7 changed files with 63 additions and 32 deletions

View File

@@ -1,6 +1,5 @@
using Manager.App.Components.Dialogs;
using Manager.App.Models.Library;
using Manager.Data.Entities.LibraryContext;
using Microsoft.AspNetCore.Components;
using MudBlazor;
@@ -8,14 +7,14 @@ namespace Manager.App.Components.Pages;
public partial class Accounts : ComponentBase
{
private MudTable<ClientAccountEntity>? _table;
private MudTable<AccountListView>? _table;
private readonly DialogOptions _dialogOptions = new() { BackdropClick = false, CloseButton = true, FullWidth = true, MaxWidth = MaxWidth.ExtraLarge };
private string _search = "";
private async Task<TableData<ClientAccountEntity>> ServerReload(TableState state, CancellationToken token)
private async Task<TableData<AccountListView>> ServerReload(TableState state, CancellationToken token)
{
var results = await LibraryService.GetAccountsAsync(_search, state.Page * state.PageSize, state.PageSize, token);
return !results.IsSuccess ? new TableData<ClientAccountEntity>() : new TableData<ClientAccountEntity>() { Items = results.Value, TotalItems = results.Total };
return !results.IsSuccess ? new TableData<AccountListView>() : new TableData<AccountListView> { Items = results.Value, TotalItems = results.Total };
}
private void OnSearch(string text)