Init first files
This commit is contained in:
7
backend/app/services/audit.py
Normal file
7
backend/app/services/audit.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from app.models.models import AuditLog
|
||||
|
||||
|
||||
async def write_audit_log(db: AsyncSession, action: str, user_id: int | None, payload: dict | None = None) -> None:
|
||||
db.add(AuditLog(action=action, user_id=user_id, payload=payload or {}))
|
||||
await db.commit()
|
||||
Reference in New Issue
Block a user