From 6589c627fad24a408fb247e356365b52465a9bce Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Sat, 25 Nov 2023 10:59:08 +0200 Subject: [PATCH] Fixed frontend --- .../Components/Grid/DataGridPaging.razor | 1 - .../Components/Grid/DataGridStreamingPaging.razor | 1 - src/BUTR.Site.NexusMods.ServerClient/Clients.cs | 4 ++-- .../Utils/PagingStreamingData.cs | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/BUTR.Site.NexusMods.Client/Components/Grid/DataGridPaging.razor b/src/BUTR.Site.NexusMods.Client/Components/Grid/DataGridPaging.razor index 3b898891..df6c743f 100644 --- a/src/BUTR.Site.NexusMods.Client/Components/Grid/DataGridPaging.razor +++ b/src/BUTR.Site.NexusMods.Client/Components/Grid/DataGridPaging.razor @@ -9,7 +9,6 @@ SelectedRowChanged="@(model => { DataGridUtils.SelectDeselect(model, ref Value, ref _dataGridRef); })" ReadData="@OnReadData" TotalItems="@Metadata.TotalCount" - CurrentPage="@Metadata.CurrentPage" PageSize="@Metadata.PageSize" SelectionMode="@DataGridSelectionMode.Single" ShowPager diff --git a/src/BUTR.Site.NexusMods.Client/Components/Grid/DataGridStreamingPaging.razor b/src/BUTR.Site.NexusMods.Client/Components/Grid/DataGridStreamingPaging.razor index 9b4be7cd..0b5bca3e 100644 --- a/src/BUTR.Site.NexusMods.Client/Components/Grid/DataGridStreamingPaging.razor +++ b/src/BUTR.Site.NexusMods.Client/Components/Grid/DataGridStreamingPaging.razor @@ -8,7 +8,6 @@ SelectedRowChanged="@(model => { DataGridUtils.SelectDeselect(model, ref Value, ref _dataGridRef); })" ReadData="@OnReadData" TotalItems="@Metadata.TotalCount" - CurrentPage="@Metadata.CurrentPage" PageSize="@Metadata.PageSize" SelectionMode="@DataGridSelectionMode.Single" ShowPager diff --git a/src/BUTR.Site.NexusMods.ServerClient/Clients.cs b/src/BUTR.Site.NexusMods.ServerClient/Clients.cs index dbddc4bd..e58b1b25 100644 --- a/src/BUTR.Site.NexusMods.ServerClient/Clients.cs +++ b/src/BUTR.Site.NexusMods.ServerClient/Clients.cs @@ -22,7 +22,7 @@ public AuthenticationClient(HttpClient client, JsonSerializerOptions options) : public partial interface ICrashReportsClient { - Task> PaginatedStreamingAsync(PaginatedQuery? body = null, CancellationToken ct = default); + Task> PaginatedStreamingAsync(PaginatedQuery body, CancellationToken ct = default); } public partial class CrashReportsClient @@ -39,7 +39,7 @@ partial void PrepareRequest(HttpClient client, HttpRequestMessage request, Strin OnPrepareRequest(client, request, urlBuilder); } - public virtual async Task> PaginatedStreamingAsync(PaginatedQuery? body = null, CancellationToken ct = default) + public virtual async Task> PaginatedStreamingAsync(PaginatedQuery body, CancellationToken ct = default) { var urlBuilder_ = new StringBuilder(); urlBuilder_.Append("api/v1/CrashReports/PaginatedStreaming"); diff --git a/src/BUTR.Site.NexusMods.ServerClient/Utils/PagingStreamingData.cs b/src/BUTR.Site.NexusMods.ServerClient/Utils/PagingStreamingData.cs index 49ad46f0..722f331a 100644 --- a/src/BUTR.Site.NexusMods.ServerClient/Utils/PagingStreamingData.cs +++ b/src/BUTR.Site.NexusMods.ServerClient/Utils/PagingStreamingData.cs @@ -58,7 +58,7 @@ async LazyTask GetStatusAsync() { var stream = await streamingJsonContext.ReadLfSeparatedJsonAsync(ct); var result = await JsonSerializer.DeserializeAsync(stream, jsonSerializerOptions, ct); - hasError = result is null || !string.IsNullOrEmpty(result.Error.Detail); + hasError = result is null || !string.IsNullOrEmpty(result.Error?.Detail); // Do not remove return result!; } async LazyTask GetMetadataAsync()