Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 7e87f9da authored by lantry-glitch's avatar lantry-glitch
Browse files

Implement subscribe function in Notification service.

parent 2a58d98a
Branches
No related tags found
No related merge requests found
...@@ -9,4 +9,10 @@ use crate::repository::subscriber::SubscriberRepository; ...@@ -9,4 +9,10 @@ use crate::repository::subscriber::SubscriberRepository;
pub struct NotificationService; pub struct NotificationService;
impl NotificationService { impl NotificationService {
pub fn subscribe(product_type: &str, subscriber: Subscriber) -> Result<Subscriber> {
let product_type_upper: String = product_type.to_uppercase();
let product_type_str: &str = product_type_upper.as_str();
let subscriber_result: Subscriber = SubscriberRepository::add(product_type_str, subscriber);
return Ok(subscriber_result);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment