Add notify module and update notification SQL query: Introduced a new notify module for handling notifications. Updated the SQL query in insert_notification_conn to use QUERY_INSERT_NOTIFICATION instead of QUERY_INSERT_NOTIFICATION_FULL, simplifying the notification insertion process.
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 1m45s

This commit is contained in:
Torsten Schulz (local)
2026-04-13 15:07:39 +02:00
parent 670ea093d0
commit df092d1790
2 changed files with 5 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ mod falukant_servants;
mod falukant_debtors;
mod falukant_transport_raid;
mod political_benefits;
mod notify;
mod sql;
pub use base::Worker;

View File

@@ -1,6 +1,6 @@
use crate::db::{ConnectionPool, DbConnection, DbError};
use crate::message_broker::MessageBroker;
use crate::worker::sql::QUERY_INSERT_NOTIFICATION_FULL;
use crate::worker::sql::QUERY_INSERT_NOTIFICATION;
/// Schreibt eine Notification in `falukant_log.notification`.
///
@@ -25,12 +25,12 @@ pub fn insert_notification_conn(
conn: &mut DbConnection,
user_id: i32,
tr: &str,
character_id: Option<i32>,
_character_id: Option<i32>,
) -> Result<(), DbError> {
conn.prepare("insert_notification_full", QUERY_INSERT_NOTIFICATION_FULL)?;
conn.prepare("insert_notification_full", QUERY_INSERT_NOTIFICATION)?;
conn.execute(
"insert_notification_full",
&[&user_id, &tr, &character_id],
&[&user_id, &tr],
)?;
Ok(())
}