Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 8f58f563 authored by Andrew4Coding's avatar Andrew4Coding
Browse files

Edit Product service methods to call notify after create/delete.

parent f46a5bf4
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,8 @@ impl ProductService {
product.product_type = product.product_type.to_uppercase();
let product_result: Product = ProductRepository::add(product);
NotificationService.notify(&product_result.product_type, "CREATED", product_result.clone());
return Ok(product_result);
}
......@@ -42,6 +44,8 @@ impl ProductService {
}
let product: Product = product_opt.unwrap();
NotificationService.notify(&product.product_type, "DELETED", product.clone());
return Ok(Json::from(product));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment