关于sap:SAP-Commerce-Cloud-Product-Review-的添加逻辑

1次阅读

共计 450 个字符,预计需要花费 2 分钟才能阅读完成。

点了 Write Review 按钮之后,调用 ProductReviewService 的 add 办法:

该办法 dispatch 一个新的 action:

override the ProductReviewService to dispatch a custom action to an effect they would create with the logic they need.

搜寻 POST_PRODUCT_REVIEW, 看看接管方是谁。

答案是『ProductReviewsEffect:接管了该 Action 之后,调用 productReviewsConnector,生产 OCC API 增加 post,待增加胜利后,返回新的 Action 对象 ProductActions.PostProductReviewSuccess,其中蕴含了 ReviewResponse.

同样在该 effect 外部,接管到 POST_PRODUCT_REVIEW_SUCCESS 之后,抛出 Thank you for review 的胜利音讯。

更多 Jerry 的原创文章,尽在:” 汪子熙 ”:

正文完
 0