From 09e5932554e18b4cb00d8bf9ac44b13877320d31 Mon Sep 17 00:00:00 2001 From: dzak27567 <fadhlurohmandzaki@gmail.com> Date: Thu, 27 Mar 2025 12:53:11 +0700 Subject: [PATCH] Implement list_all_as_string function in Notification repository --- src/repository/notification.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/repository/notification.rs b/src/repository/notification.rs index 907f2cb..273059f 100644 --- a/src/repository/notification.rs +++ b/src/repository/notification.rs @@ -16,5 +16,10 @@ impl NotificationRepository { NOTIFICATIONS.write().unwrap() .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