fix(blog): add restore path for archived posts
TaxBaik CI/CD / build-and-deploy (push) Successful in 4m57s
TaxBaik CI/CD / build-and-deploy (push) Successful in 4m57s
This commit is contained in:
@@ -149,6 +149,14 @@ public class BlogPostRepository(IDbConnectionFactory connectionFactory) : BaseRe
|
||||
new { Id = id });
|
||||
}
|
||||
|
||||
public async Task RestoreAsync(int id, CancellationToken cancellationToken = default)
|
||||
{
|
||||
using var conn = Conn();
|
||||
await conn.ExecuteAsync(
|
||||
"UPDATE blog_posts SET deleted_at = NULL, updated_at = NOW() WHERE id = @Id AND deleted_at IS NOT NULL",
|
||||
new { Id = id });
|
||||
}
|
||||
|
||||
public async Task IncrementViewCountAsync(int id, CancellationToken cancellationToken = default)
|
||||
{
|
||||
using var conn = Conn();
|
||||
|
||||
Reference in New Issue
Block a user