diff --git a/src/repository/notification.rs b/src/repository/notification.rs index 7ccb81666410de0a8e33e9e96d1df0d37bddff60..3a1393e8addda91c67af7cf0a3887b7d03e6686c 100644 --- a/src/repository/notification.rs +++ b/src/repository/notification.rs @@ -1,14 +1,19 @@ +use std::sync::RwLock; + use lazy_static::lazy_static; -use rocket::tokio::sync::RwLock; use crate::model::notification::Notification; lazy_static! { - static ref NOIIFICATIONS: RwLock<Vec<Notification>> = RwLock::new(Vec::new()); + static ref NOTIFICATIONS: RwLock<Vec<Notification>> = RwLock::new(Vec::new()); } pub struct NotificationRepository; impl NotificationRepository { + pub async fn add_notification(notification: Notification) -> Notification { + NOTIFICATIONS.write().unwrap().push(notification.clone()); + notification + } } \ No newline at end of file