backend adaptations due to cox change role
This commit is contained in:
@ -89,6 +89,32 @@ impl Notification {
|
||||
tx.commit().await.unwrap();
|
||||
}
|
||||
|
||||
pub async fn create_for_steering_people_tx(
|
||||
db: &mut Transaction<'_, Sqlite>,
|
||||
message: &str,
|
||||
category: &str,
|
||||
link: Option<&str>,
|
||||
action_after_reading: Option<&str>,
|
||||
) {
|
||||
let cox = Role::find_by_name_tx(db, "cox").await.unwrap();
|
||||
Self::create_for_role_tx(db, &cox, message, category, link, action_after_reading).await;
|
||||
let bootsf = Role::find_by_name_tx(db, "Bootsführer").await.unwrap();
|
||||
Self::create_for_role_tx(db, &bootsf, message, category, link, action_after_reading).await;
|
||||
}
|
||||
|
||||
pub async fn create_for_steering_people(
|
||||
db: &SqlitePool,
|
||||
message: &str,
|
||||
category: &str,
|
||||
link: Option<&str>,
|
||||
action_after_reading: Option<&str>,
|
||||
) {
|
||||
let cox = Role::find_by_name(db, "cox").await.unwrap();
|
||||
Self::create_for_role(db, &cox, message, category, link, action_after_reading).await;
|
||||
let bootsf = Role::find_by_name(db, "Bootsführer").await.unwrap();
|
||||
Self::create_for_role(db, &bootsf, message, category, link, action_after_reading).await;
|
||||
}
|
||||
|
||||
pub async fn for_user(db: &SqlitePool, user: &User) -> Vec<Self> {
|
||||
let rows = sqlx::query!(
|
||||
"
|
||||
|
Reference in New Issue
Block a user