diff --git a/backend/api/audit.py b/backend/api/audit.py index f3edb6c..040b163 100644 --- a/backend/api/audit.py +++ b/backend/api/audit.py @@ -117,7 +117,7 @@ def _build_filtered_query( if user_id is not None: q = q.where(AuditLog.user_id == user_id) if event_type is not None: - q = q.where(AuditLog.event_type == event_type) + q = q.where(AuditLog.event_type.like(f"{event_type}%")) return q @@ -156,7 +156,7 @@ def _build_filtered_query_with_handles( if user_uuid is not None: q = q.where(AuditLog.user_id == user_uuid) if event_type is not None: - q = q.where(AuditLog.event_type == event_type) + q = q.where(AuditLog.event_type.like(f"{event_type}%")) return q @@ -281,7 +281,7 @@ async def list_audit_log( if user_uuid is not None: count_q = count_q.where(AuditLog.user_id == user_uuid) if event_type is not None: - count_q = count_q.where(AuditLog.event_type == event_type) + count_q = count_q.where(AuditLog.event_type.like(f"{event_type}%")) count_result = await session.execute(count_q) total = count_result.scalar_one()