better phrasing of text
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m38s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
philipp 2024-05-30 10:39:55 +02:00
parent 3c0b8e5114
commit 562c32939d

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",