Fix blog category fallback and empty card
TaxBaik CI/CD / build-and-deploy (push) Successful in 58s

This commit is contained in:
2026-07-09 16:09:54 +09:00
parent 89d457c549
commit 8acc988174
2 changed files with 5 additions and 9 deletions
@@ -54,6 +54,7 @@ public class BlogService(
public async Task<int> CreateAsync(BlogPost post, CancellationToken ct = default)
{
ValidatePost(post);
post.CategoryId ??= await EnsureCategoryIdAsync(0, ct);
post.Title = post.Title.Trim();
post.Content = post.Content.Trim();
post.Slug = await GenerateUniqueSlugAsync(post.Title, ct: ct);
@@ -88,6 +89,7 @@ public class BlogService(
public async Task UpdateAsync(BlogPost post, CancellationToken ct = default)
{
post.CategoryId ??= await EnsureCategoryIdAsync(0, ct);
await repository.UpdateAsync(post, ct);
memoryCache.Remove(AdminDashboardService.CacheKey);
}