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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user