mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-07-03 14:43:28 +00:00
Return format string with admin logs
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
//!
|
||||
//! @author Pierre Hubert
|
||||
|
||||
use crate::data::admin_action_log::{AdminActionLog, AdminAction};
|
||||
use crate::data::admin_action_log::{AdminAction, AdminActionLog};
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct AdminLogAPI {
|
||||
@ -10,17 +10,19 @@ pub struct AdminLogAPI {
|
||||
admin_id: u64,
|
||||
ip: String,
|
||||
time: u64,
|
||||
action: AdminAction
|
||||
action: AdminAction,
|
||||
format: &'static str,
|
||||
}
|
||||
|
||||
impl AdminLogAPI {
|
||||
pub fn new(log: &AdminActionLog) -> Self{
|
||||
pub fn new(log: &AdminActionLog) -> Self {
|
||||
Self {
|
||||
id: log.id,
|
||||
admin_id: log.admin_id.id(),
|
||||
ip: log.ip.to_string(),
|
||||
time: log.time,
|
||||
action: log.action.clone()
|
||||
action: log.action.clone(),
|
||||
format: log.action.format_string(),
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user