mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 00:51:12 -05:00
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:
@@ -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],
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user