From 5009384ccf0fb75e5042f7e268c447374f630c1e Mon Sep 17 00:00:00 2001 From: Scallss <pascalhafidz2005@gmail.com> Date: Fri, 28 Mar 2025 17:05:18 +0700 Subject: [PATCH] Implement list_all_as_string function in Subscriber repository. --- src/repository/notification.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/repository/notification.rs b/src/repository/notification.rs index 0896000..1e0e0d5 100644 --- a/src/repository/notification.rs +++ b/src/repository/notification.rs @@ -16,4 +16,11 @@ impl NotificationRepository { .push(notification.clone()); return notification; } + + pub fn list_all_as_string() -> Vec<String> { + return NOTIFICATIONS.read().unwrap() + .iter() + .map(|f| format!("{}", f.clone())) + .collect(); + } } \ No newline at end of file -- GitLab