remove users from trip after they have read the notificatoin
Some checks failed
CI/CD Pipeline / test (push) Failing after 3m50s
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-21 19:41:00 +02:00
parent 1285c3bc28
commit b4967b54e9
12 changed files with 62 additions and 20 deletions

View File

@ -80,6 +80,7 @@ impl Trip {
),
"Neue Ausfahrt zur selben Zeit",
None,
None,
)
.await;
}
@ -209,10 +210,9 @@ WHERE day=?
let rowers = TripWithUserAndType::from(db, trip.clone()).await.rower;
for user in rowers {
if let Some(user) = User::find_by_name(db, &user.name).await {
let notes = if let Some(notes) = notes {
format!(": {notes}")
} else {
String::from(".")
let notes = match notes {
Some(n) if !n.is_empty() => n,
_ => ".",
};
Notification::create(
@ -224,6 +224,10 @@ WHERE day=?
),
"Absage Ausfahrt",
None,
Some(&format!(
"remove_user_trip_with_trip_details_id:{}",
trip_details_id
)),
)
.await;
}