This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -25,16 +25,10 @@
|
||||
|
||||
@if (Model.Items.Count == 0)
|
||||
{
|
||||
<div class="empty py-5 border rounded bg-body">
|
||||
<div class="empty-img">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-database-off" width="48" height="48" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M4 6c0 1.657 4.03 3 9 3s9-1.343 9-3-4.03-3-9-3-9 1.343-9 3"></path>
|
||||
<path d="M4 6v6c0 1.657 4.03 3 9 3s9-1.343 9-3V6"></path>
|
||||
<path d="M4 12v6c0 1.657 4.03 3 9 3s9-1.343 9-3v-6"></path>
|
||||
<path d="M3 3l18 18"></path>
|
||||
</svg>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
@await Html.PartialAsync("_EmptyState", "블로그 글이 없습니다.")
|
||||
</div>
|
||||
<p class="empty-title">블로그 글이 없습니다.</p>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user