allow to add reason for canceled event; fixes #530
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m4s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2024-05-22 08:04:17 +02:00
parent 9704893329
commit a797180b0d
3 changed files with 13 additions and 12 deletions

View File

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