Initial public release
This commit is contained in:
commit
c1107147b4
92 files changed
+10562
No files matched your search
@@ -0,0 +1,25 @@
|
||||
use crate::db::Db;
|
||||
use crate::models::AuditLog;
|
||||
use crate::error::AppError;
|
||||
|
||||
pub fn log_action(
|
||||
db: &Db,
|
||||
username: &str,
|
||||
action: &str,
|
||||
object_type: Option<&str>,
|
||||
object_id: Option<&str>,
|
||||
ip_address: Option<&str>,
|
||||
user_agent: Option<&str>,
|
||||
) -> Result<AuditLog, AppError> {
|
||||
let conn = db.admin.lock().unwrap();
|
||||
let log = crate::db::admin::write_audit_log(
|
||||
&conn,
|
||||
username,
|
||||
action,
|
||||
object_type,
|
||||
object_id,
|
||||
ip_address,
|
||||
user_agent,
|
||||
)?;
|
||||
Ok(log)
|
||||
}
|
||||
Reference in new issue
Block a user