Problem
When GetBlogPostByIdQuery returns Result.Ok<BlogPostDto?>(null) (post doesn't exist), Edit.razor's OnParametersSetAsync sets _model = null and leaves _error as null. The template's @if (_model is null && _error is null) then renders 'Loading...' indefinitely.
This bug was identified in the Copilot review of PR #304 but the PR was merged before it was addressed.
Fix
Change the null-value branch from _model = null to Navigation.NavigateTo("/blog"); return;, matching the non-owner/non-admin redirect pattern.
Acceptance
Problem
When
GetBlogPostByIdQueryreturnsResult.Ok<BlogPostDto?>(null)(post doesn't exist),Edit.razor'sOnParametersSetAsyncsets_model = nulland leaves_erroras null. The template's@if (_model is null && _error is null)then renders 'Loading...' indefinitely.This bug was identified in the Copilot review of PR #304 but the PR was merged before it was addressed.
Fix
Change the null-value branch from
_model = nulltoNavigation.NavigateTo("/blog"); return;, matching the non-owner/non-admin redirect pattern.Acceptance
Edit.razorredirects to/blogwhen post is not foundEditRedirectsToBlogWhenPostNotFoundpasses