From b6ca964adbcefe58ed7f431cf57b8fda2293fdcc Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Thu, 17 Dec 2015 11:01:49 +0100 Subject: [PATCH] Fix contractAgreementList not updating correctly after initial creation --- js/actions/contract_agreement_list_actions.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/actions/contract_agreement_list_actions.js b/js/actions/contract_agreement_list_actions.js index 1eedf5b0..b5337d4c 100644 --- a/js/actions/contract_agreement_list_actions.js +++ b/js/actions/contract_agreement_list_actions.js @@ -83,9 +83,9 @@ class ContractAgreementListActions { contractAgreementList in the store is already set to null; */ } - }).then((publicContracAgreement) => { - if (publicContracAgreement) { - this.actions.updateContractAgreementList([publicContracAgreement]); + }).then((publicContractAgreement) => { + if (publicContractAgreement) { + this.actions.updateContractAgreementList([publicContractAgreement]); } }).catch(console.logGlobal); } @@ -93,7 +93,10 @@ class ContractAgreementListActions { createContractAgreement(issuer, contract){ return Q.Promise((resolve, reject) => { OwnershipFetcher - .createContractAgreement(issuer, contract).then(resolve) + .createContractAgreement(issuer, contract) + .then((res) => { + resolve(res && res.contractagreement) + }) .catch((err) => { console.logGlobal(err); reject(err);