[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,4 +1,4 @@
using Manager.Data.Entities.LibraryContext;
using Manager.App.Models.Library;
using Microsoft.AspNetCore.Components;
using MudBlazor;
@@ -6,13 +6,13 @@ namespace Manager.App.Components.Pages;
public partial class Channels : ComponentBase
{
private MudTable<ChannelEntity>? _table;
private MudTable<ChannelListView>? _table;
private string _search = "";
private async Task<TableData<ChannelEntity>> ServerReload(TableState state, CancellationToken token)
private async Task<TableData<ChannelListView>> ServerReload(TableState state, CancellationToken token)
{
var results = await LibraryService.GetChannelsAsync(_search, state.Page * state.PageSize, state.PageSize, token);
return !results.IsSuccess ? new TableData<ChannelEntity>() : new TableData<ChannelEntity> { Items = results.Value, TotalItems = results.Total };
return !results.IsSuccess ? new TableData<ChannelListView>() : new TableData<ChannelListView> { Items = results.Value, TotalItems = results.Total };
}
private void OnSearch(string text)