better-text #564

Merged
philipp merged 3 commits from better-text into main 2024-05-30 11:52:18 +02:00
Showing only changes of commit 562c32939d - Show all commits

View File

@ -282,16 +282,17 @@ WHERE trip_details.id=?
let rower = Registration::all_rower(db, self.trip_details_id).await; let rower = Registration::all_rower(db, self.trip_details_id).await;
for user in rower { for user in rower {
if let Some(user) = User::find_by_name(db, &user.name).await { if let Some(user) = User::find_by_name(db, &user.name).await {
let notes = match update.notes { let notes = if let Some(notes) = update.notes {
Some(n) if !n.is_empty() => n, format!("Grund der Absage: {notes}")
_ => ".", } else {
String::from("")
}; };
Notification::create( Notification::create(
db, db,
&user, &user,
&format!( &format!(
"Die Ausfahrt {} am {} um {} wurde abgesagt{}", "Die Ausfahrt {} am {} um {} wurde abgesagt. {}",
self.name, self.day, self.planned_starting_time, notes self.name, self.day, self.planned_starting_time, notes
), ),
"Absage Ausfahrt", "Absage Ausfahrt",