Fix backend bugs: password hash column rename, dynamic import, AuditLog response_model, websocket reference, missing exports, bcrypt version pin
This commit is contained in:
@@ -184,7 +184,7 @@ async def list_logs(
|
||||
]
|
||||
|
||||
|
||||
@router.post("/audit", response_model=AuditLog)
|
||||
@router.post("/audit", response_model=dict)
|
||||
async def log_audit(
|
||||
action_type: str,
|
||||
target_user_id: Optional[int] = None,
|
||||
@@ -210,4 +210,11 @@ async def log_audit(
|
||||
db.add(new_audit)
|
||||
await db.flush()
|
||||
|
||||
return AuditLog.model_validate(new_audit)
|
||||
return {
|
||||
"id": new_audit.id,
|
||||
"admin_id": new_audit.admin_id,
|
||||
"action_type": new_audit.action_type,
|
||||
"target_user_id": new_audit.target_user_id,
|
||||
"details": new_audit.details,
|
||||
"timestamp": new_audit.timestamp,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user