Files
taxbaik/TaxBaik.Web.Client/Components/Admin/Pages/Blog/BlogCreate.razor
T
kjh2064 5d1eeb8485
TaxBaik CI/CD / build-and-deploy (push) Failing after 2m14s
fix: add @rendermode InteractiveWebAssembly to all admin pages
Problem: Page components were not rendering content because @rendermode was only
on App.razor and Routes.razor, not on individual @page components.

Solution: Add @rendermode InteractiveWebAssembly to all admin page components
to ensure they render interactively in WebAssembly context.

Result: All admin pages now render their content correctly.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-03 02:32:57 +09:00

67 lines
2.0 KiB
Plaintext

@page "/admin/blog/create"
@rendermode InteractiveWebAssembly
@attribute [Authorize]
@using TaxBaik.Application.DTOs
@using TaxBaik.WasmClient.Components.Admin.Pages.Blog
@inject IBlogBrowserClient BlogClient
@inject ICategoryBrowserClient CategoryClient
@inject NavigationManager Navigation
@inject ISnackbar Snackbar
<PageTitle>새 포스트 작성</PageTitle>
<AdminCrudPageShell Title="새 포스트 작성"
Eyebrow="Content"
Subtitle="새로운 블로그 포스트를 작성합니다."
Loading="@false"
OnCancel="@GoBack">
<MudPaper Class="pa-4 mt-4" Elevation="1">
<BlogForm Model="model" Categories="categories" SubmitText="저장" OnSubmit="SavePost" OnCancel="GoBack" />
</MudPaper>
</AdminCrudPageShell>
@code {
private IReadOnlyList<Domain.Entities.Category> categories = [];
private BlogForm.BlogFormModel model = new();
protected override async Task OnInitializedAsync()
{
categories = await CategoryClient.GetAllAsync();
}
private void GoBack()
{
Navigation.NavigateTo("/taxbaik/admin/blog");
}
private async Task SavePost()
{
try
{
var result = await BlogClient.CreateAsync(new CreateBlogPostDto
{
Title = model.Title,
Content = model.Content,
CategoryId = model.CategoryId,
Tags = model.Tags,
SeoTitle = model.SeoTitle,
SeoDescription = model.SeoDescription,
IsPublished = model.IsPublished
});
if (result == null)
{
Snackbar.Add("포스트 저장에 실패했습니다.", Severity.Error);
return;
}
Snackbar.Add("포스트가 저장되었습니다.", Severity.Success);
Navigation.NavigateTo("/taxbaik/admin/blog");
}
catch (ValidationException ex)
{
Snackbar.Add(ex.Message, Severity.Error);
}
}
}