mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 12:43:11 +10:00
Send the enquiry message to the created transaction
This commit is contained in:
parent
683b989e1f
commit
251e496e11
2 changed files with 7 additions and 6 deletions
|
|
@ -114,7 +114,6 @@ export const fetchReviews = listingId => (dispatch, getState, sdk) => {
|
|||
};
|
||||
|
||||
export const sendEnquiry = (listingId, message) => (dispatch, getState, sdk) => {
|
||||
console.log('sendEnquiry:', listingId.uuid, message);
|
||||
dispatch(sendEnquiryRequest());
|
||||
const bodyParams = {
|
||||
transition: propTypes.TX_TRANSITION_ENQUIRE,
|
||||
|
|
@ -123,10 +122,13 @@ export const sendEnquiry = (listingId, message) => (dispatch, getState, sdk) =>
|
|||
return sdk.transactions
|
||||
.initiate(bodyParams)
|
||||
.then(response => {
|
||||
const txId = response.data.data.id;
|
||||
// TODO: send message to the transaction
|
||||
dispatch(sendEnquirySuccess());
|
||||
return txId;
|
||||
const transactionId = response.data.data.id;
|
||||
|
||||
// Send the message to the created transaction
|
||||
return sdk.messages.send({ transactionId, content: message }).then(() => {
|
||||
dispatch(sendEnquirySuccess());
|
||||
return transactionId;
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
dispatch(sendEnquiryError(storableError(e)));
|
||||
|
|
|
|||
|
|
@ -192,7 +192,6 @@ export class ListingPageComponent extends Component {
|
|||
|
||||
onSendEnquiry(listingId, msg)
|
||||
.then(txId => {
|
||||
console.log('enquiry success, redirect to tx page:', txId.uuid);
|
||||
this.setState({ enquiryModalOpen: false });
|
||||
|
||||
// Redirect to OrderDetailsPage
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue