pub async fn acknowledge_alert(
pool: &Pool<MySql>,
alert_id: i64,
user_id: i64,
notes: Option<&str>,
update_status: bool,
) -> Result<AlertAcknowledgment>Expand description
Acknowledges an alert by a specific user.
This function creates an acknowledgment record for the alert and optionally updates the alert status to ‘acknowledged’ if it’s currently ‘active’.
§Arguments
pool- Database connection pool for executing the queryalert_id- ID of the alert to acknowledgeuser_id- ID of the user acknowledging the alertnotes- Optional notes about the acknowledgmentupdate_status- Whether to update the alert status to ‘acknowledged’
§Returns
Ok(AlertAcknowledgment)- Successfully created acknowledgmentErr(anyhow::Error)- Failed to acknowledge alert