From 0c925c8c2d753e6b6ca7ff5f98d9a579767d0a49 Mon Sep 17 00:00:00 2001
From: Scallss <pascalhafidz2005@gmail.com>
Date: Fri, 28 Mar 2025 17:47:41 +0700
Subject: [PATCH] Implement receive_notification function in Notification
 service.

---
 src/service/notification.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/service/notification.rs b/src/service/notification.rs
index 755d085..2e42203 100644
--- a/src/service/notification.rs
+++ b/src/service/notification.rs
@@ -1,3 +1,4 @@
+use std::ops::Not;
 use std::thread;
 
 use rocket::http::Status;
@@ -91,4 +92,9 @@ impl NotificationService {
 
         return thread::spawn(move || Self::unsubscribe_request(product_type_clone)).join().unwrap();
     }
+
+    pub fn receive_notification(payload: Notification) -> Result<Notification> {
+        let subcriber_result: Notification = NotificationRepository::add(payload);
+        return Ok(subcriber_result);
+    }
 }
\ No newline at end of file
-- 
GitLab