Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 1d3f097d authored by Christian Raphael Heryanto's avatar Christian Raphael Heryanto
Browse files

Implement subscribe function in Notification service.

parent 74200930
Branches
No related tags found
No related merge requests found
...@@ -9,4 +9,11 @@ use rocket::http::Status; ...@@ -9,4 +9,11 @@ use rocket::http::Status;
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