better-text #562

Merged
philipp merged 5 commits from better-text into staging 2024-05-30 11:12:04 +02:00
Showing only changes of commit 1bd643f6f4 - Show all commits

View File

@ -135,12 +135,22 @@ ORDER BY read_at DESC, created_at DESC;
.await .await
.unwrap(); .unwrap();
println!("in mark_read");
if let Some(action) = self.action_after_reading.as_ref() { if let Some(action) = self.action_after_reading.as_ref() {
println!("{action:#?}");
// User read notification about cancelled trip/event // User read notification about cancelled trip/event
let re = Regex::new(r"^remove_user_trip_with_trip_details_id:(\d+)$").unwrap(); let re = Regex::new(r"^remove_user_trip_with_trip_details_id:(\d+)$").unwrap();
if let Some(caps) = re.captures(action) { if let Some(caps) = re.captures(action) {
println!("in 2nd if");
if let Some(matched) = caps.get(1) { if let Some(matched) = caps.get(1) {
println!("in 3rd if");
if let Ok(number) = matched.as_str().parse::<i32>() { if let Ok(number) = matched.as_str().parse::<i32>() {
println!("number: {number}");
println!(
"DELETE FROM user_trip WHERE user_id = {} AND trip_details_id = {}",
self.user_id, number
);
let _ = sqlx::query!( let _ = sqlx::query!(
"DELETE FROM user_trip WHERE user_id = ? AND trip_details_id = ?", "DELETE FROM user_trip WHERE user_id = ? AND trip_details_id = ?",
self.user_id, self.user_id,