remove donau linz stuff
Some checks failed
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled

This commit is contained in:
2024-12-11 21:49:54 +01:00
parent 2ec6e61578
commit 7a945c11e3
5 changed files with 20 additions and 57 deletions

View File

@@ -232,10 +232,8 @@ WHERE trip_details.id=?
}
async fn advertise(db: &SqlitePool, day: &str, planned_starting_time: &str, name: &str) {
let donau = Role::find_by_name(db, "Donau Linz").await.unwrap();
Notification::create_for_role(
Notification::create_for_all(
db,
&donau,
&format!("Am {} um {} wurde ein neues Event angelegt: {} Wir freuen uns wenn du dabei mitmachst, die Anmeldung ist ab sofort offen :-)", day, planned_starting_time, name),
"Neues Event",
Some(&format!("/planned#{day}")),

View File

@@ -89,6 +89,20 @@ impl Notification {
tx.commit().await.unwrap();
}
pub async fn create_for_all(
db: &SqlitePool,
message: &str,
category: &str,
link: Option<&str>,
action_after_reading: Option<&str>,
) {
let users = User::all(db).await;
for user in users {
Self::create(db, &user, message, category, link, action_after_reading).await;
}
}
pub async fn create_for_steering_people_tx(
db: &mut Transaction<'_, Sqlite>,
message: &str,

View File

@@ -7,10 +7,7 @@ use crate::model::{event::Event, trip::Trip, user::User};
pub(crate) async fn get_personal_cal(db: &SqlitePool, user: &User) -> String {
let mut calendar = ICalendar::new("2.0", "ics-rs");
calendar.push(Property::new(
"X-WR-CALNAME",
"Donau Linz - Deine Ausfahrten",
));
calendar.push(Property::new("X-WR-CALNAME", "ruad.at - Deine Ausfahrten"));
let events = Event::all_with_user(db, user).await;
for event in events {