diff --git a/backend/__pycache__/api_routes.cpython-314.pyc b/backend/__pycache__/api_routes.cpython-314.pyc index 8d912e3..b7cc98c 100644 Binary files a/backend/__pycache__/api_routes.cpython-314.pyc and b/backend/__pycache__/api_routes.cpython-314.pyc differ diff --git a/backend/api_routes.py b/backend/api_routes.py index ef9d66d..8bfb42c 100644 --- a/backend/api_routes.py +++ b/backend/api_routes.py @@ -874,9 +874,14 @@ def api_delete_post(post_id: int): delete_rights(post_id) delete_audio_post(post_id) - # ❌ Skip audit log for now + add_audit_log({ + "post_id": post_id, + "user_id": user_id, + "action": "post.deleted", + "details": json.dumps({"title": post.get("title")}) + }) - return jsonify({"message": "Post and all related data deleted successfully", "post_id": post_id}) + return jsonify({"message": "Post deleted successfully", "post_id": post_id}) except Exception as e: return _error(f"Failed to delete post: {str(e)}", 500) diff --git a/frontend/src/components/AudioPostCard.jsx b/frontend/src/components/AudioPostCard.jsx index 3c46b4b..5705e4c 100644 --- a/frontend/src/components/AudioPostCard.jsx +++ b/frontend/src/components/AudioPostCard.jsx @@ -153,7 +153,7 @@ export default function AudioPostCard({ post, onViewPost }) { const handleView = (postId) => { if (onViewPost) { - onViewPost(post.postId) + onViewPost(postId) } } @@ -219,7 +219,7 @@ export default function AudioPostCard({ post, onViewPost }) { )} {post.status === 'ready' && (