From 1bd643f6f471a5bb30bb42bb5e0f61489daf7bec Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 30 May 2024 11:11:08 +0200 Subject: [PATCH] try --- src/model/notification.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/model/notification.rs b/src/model/notification.rs index 9bb242e..d3bcd81 100644 --- a/src/model/notification.rs +++ b/src/model/notification.rs @@ -135,12 +135,22 @@ ORDER BY read_at DESC, created_at DESC; .await .unwrap(); + println!("in mark_read"); + if let Some(action) = self.action_after_reading.as_ref() { + println!("{action:#?}"); // User read notification about cancelled trip/event let re = Regex::new(r"^remove_user_trip_with_trip_details_id:(\d+)$").unwrap(); if let Some(caps) = re.captures(action) { + println!("in 2nd if"); if let Some(matched) = caps.get(1) { + println!("in 3rd if"); if let Ok(number) = matched.as_str().parse::() { + println!("number: {number}"); + println!( + "DELETE FROM user_trip WHERE user_id = {} AND trip_details_id = {}", + self.user_id, number + ); let _ = sqlx::query!( "DELETE FROM user_trip WHERE user_id = ? AND trip_details_id = ?", self.user_id,