refactor(comment): unify status transitions with atomic count maintenance
Consolidate comment status changes through transitionStatus() to ensure posts.comments_count and comments.replies_count are atomically maintained within the same transaction, preventing inconsistencies between displayed and stored counts. - Remove separate ApplyPublishedStats() calls, now handled in UpdateModerationStatus - Add cache invalidation for admin moderation operations - Update report auto-hide to use unified status transition
This commit is contained in:
@@ -127,7 +127,7 @@ func InitializeApp() (*App, error) {
|
||||
adminUserHandler := handler.NewAdminUserHandler(adminUserService, pushService)
|
||||
adminPostService := wire.ProvideAdminPostService(postRepository, cache, logService)
|
||||
adminPostHandler := handler.NewAdminPostHandler(adminPostService)
|
||||
adminCommentService := wire.ProvideAdminCommentService(commentRepository, postRepository)
|
||||
adminCommentService := wire.ProvideAdminCommentService(commentRepository, postRepository, cache)
|
||||
adminCommentHandler := handler.NewAdminCommentHandler(adminCommentService)
|
||||
adminGroupService := wire.ProvideAdminGroupService(groupRepository, userRepository)
|
||||
adminGroupHandler := handler.NewAdminGroupHandler(adminGroupService)
|
||||
|
||||
Reference in New Issue
Block a user