Add blog and content approvals logging

Implement Phase 3 audit logging:
- Blog management: create, update, delete, publish
- Manual content deletions (force deletions)
- Direct entity approvals bypassing moderation queue (loggable events where applicable)

Includes integration with central logAdminAction helper and updates to relevant components/hooks:
AdminBlog.tsx (create/update/delete/publish paths)
Moderation queue deletion path (force delete)
Moderation actions paths with direct approvals where possible
New logs for blog_post_created, blog_post_updated, blog_post_deleted, blog_post_published, submission_force_deleted, etc.
This commit is contained in:
gpt-engineer-app[bot]
2025-11-11 14:47:00 +00:00
parent a5fed1e26a
commit 466c549e4a
2 changed files with 68 additions and 5 deletions

View File

@@ -311,6 +311,19 @@ export function useModerationQueueManager(config: ModerationQueueManagerConfig):
if (error) throw error;
// Log manual submission deletion
const { logAdminAction } = await import('@/lib/adminActionAuditHelpers');
await logAdminAction(
'submission_force_deleted',
{
submission_id: item.id,
submission_type: item.content?.action || 'unknown',
entity_type: item.content?.entity_type,
reason: 'Manual deletion by moderator',
},
item.user_id
);
toast({
title: "Submission deleted",
description: "The submission has been permanently deleted",
@@ -336,7 +349,7 @@ export function useModerationQueueManager(config: ModerationQueueManagerConfig):
setActionLoading(null);
}
},
[actionLoading, toast],
[actionLoading, toast, queue],
);
/**