mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Reviews and stuff needs to be included.
This commit is contained in:
parent
7bd32ba3ba
commit
bcfd2c6567
2 changed files with 16 additions and 4 deletions
|
|
@ -247,12 +247,16 @@ export const sendMessage = (orderId, message) => (dispatch, getState, sdk) => {
|
|||
});
|
||||
};
|
||||
|
||||
const REVIEW_TX_INCLUDES = ['reviews', 'reviews.author', 'reviews.subject'];
|
||||
|
||||
// If other party (provider) has already sent a review, we need to make transition to
|
||||
// TX_TRANSITION_REVIEW_BY_CUSTOMER_SECOND
|
||||
const sendReviewAsSecond = (id, params, dispatch, sdk) => {
|
||||
const transition = propTypes.TX_TRANSITION_REVIEW_BY_CUSTOMER_SECOND;
|
||||
const include = REVIEW_TX_INCLUDES;
|
||||
|
||||
return sdk.transactions
|
||||
.transition({ id, transition, params }, { expand: true })
|
||||
.transition({ id, transition, params }, { expand: true, include })
|
||||
.then(response => {
|
||||
dispatch(addMarketplaceEntities(response));
|
||||
dispatch(sendReviewSuccess());
|
||||
|
|
@ -274,8 +278,10 @@ const sendReviewAsSecond = (id, params, dispatch, sdk) => {
|
|||
// by calling sendReviewAsSecond().
|
||||
const sendReviewAsFirst = (id, params, dispatch, sdk) => {
|
||||
const transition = propTypes.TX_TRANSITION_REVIEW_BY_CUSTOMER_FIRST;
|
||||
const include = REVIEW_TX_INCLUDES;
|
||||
|
||||
return sdk.transactions
|
||||
.transition({ id, transition, params }, { expand: true })
|
||||
.transition({ id, transition, params }, { expand: true, include })
|
||||
.then(response => {
|
||||
dispatch(addMarketplaceEntities(response));
|
||||
dispatch(sendReviewSuccess());
|
||||
|
|
|
|||
|
|
@ -316,12 +316,16 @@ export const sendMessage = (saleId, message) => (dispatch, getState, sdk) => {
|
|||
});
|
||||
};
|
||||
|
||||
const REVIEW_TX_INCLUDES = ['reviews', 'reviews.author', 'reviews.subject'];
|
||||
|
||||
// If other party (customer) has already sent a review, we need to make transition to
|
||||
// TX_TRANSITION_REVIEW_BY_PROVIDER_SECOND
|
||||
const sendReviewAsSecond = (id, params, dispatch, sdk) => {
|
||||
const transition = propTypes.TX_TRANSITION_REVIEW_BY_PROVIDER_SECOND;
|
||||
const include = REVIEW_TX_INCLUDES;
|
||||
|
||||
return sdk.transactions
|
||||
.transition({ id, transition, params }, { expand: true })
|
||||
.transition({ id, transition, params }, { expand: true, include })
|
||||
.then(response => {
|
||||
dispatch(addMarketplaceEntities(response));
|
||||
dispatch(sendReviewSuccess());
|
||||
|
|
@ -343,8 +347,10 @@ const sendReviewAsSecond = (id, params, dispatch, sdk) => {
|
|||
// by calling sendReviewAsSecond().
|
||||
const sendReviewAsFirst = (id, params, dispatch, sdk) => {
|
||||
const transition = propTypes.TX_TRANSITION_REVIEW_BY_PROVIDER_FIRST;
|
||||
const include = REVIEW_TX_INCLUDES;
|
||||
|
||||
return sdk.transactions
|
||||
.transition({ id, transition, params }, { expand: true })
|
||||
.transition({ id, transition, params }, { expand: true, include })
|
||||
.then(response => {
|
||||
dispatch(addMarketplaceEntities(response));
|
||||
dispatch(sendReviewSuccess());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue