remove users from trip after they have read the notificatoin
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user