Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 4c2e3d51 authored by TheoKevH's avatar TheoKevH
Browse files

Implement subscribe function in Notification service

parent 67dd29fe
No related branches found
No related tags found
No related merge requests found
......@@ -10,4 +10,10 @@ use crate::repository::subscriber::SubscriberRepository;
pub struct 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);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment