pub async fn create_notification_acknowledgment(
pool: &Pool<MySql>,
user_id: i64,
notification_id: Option<i64>,
role_notification_id: Option<i64>,
) -> Result<NotificationAcknowledgment>
Expand description
Creates a notification acknowledgment for a user.
This function records that a user has acknowledged a notification, which is useful for role-based notifications that need individual tracking.
§Arguments
pool
- Database connection pool for executing the queryuser_id
- ID of the user acknowledging the notificationnotification_id
- Optional ID of a user notification being acknowledgedrole_notification_id
- Optional ID of a role notification being acknowledged
§Returns
Ok(NotificationAcknowledgment)
- Successfully created acknowledgmentErr(anyhow::Error)
- Failed to create acknowledgment