1
0
mirror of https://github.com/ascribe/onion.git synced 2024-07-01 06:02:12 +02:00

Merge remote-tracking branch 'origin/AD-943-add-custom-additional-fields' into AD-943-add-custom-additional-fields

This commit is contained in:
diminator 2015-09-17 14:22:19 +02:00
commit 2bd148407b
2 changed files with 12 additions and 20 deletions

View File

@ -90,9 +90,7 @@ class ContractAgreementListActions {
} }
flushContractAgreementList(){ flushContractAgreementList(){
return Q.Promise((resolve, reject) => { this.actions.updateContractAgreementList(null);
return this.actions.updateContractAgreementList(null);
});
} }
} }

View File

@ -77,24 +77,18 @@ let LoanForm = React.createClass({
}, },
getContractAgreementsOrCreatePublic(email){ getContractAgreementsOrCreatePublic(email){
/* a more complex defer (with promises) otherwise we dispatch while an action is being dispatched) */ ContractAgreementListActions.flushContractAgreementList();
window.setTimeout(() => { if (email) {
ContractAgreementListActions.flushContractAgreementList() // fetch the available contractagreements (pending/accepted)
.catch((err) => { ContractAgreementListActions.fetchAvailableContractAgreementList(email).then(
console.logGlobal(err); (contractAgreementList) => {
}); if (!contractAgreementList && this.props.createPublicContractAgreement) {
// for public contracts: fetch the public contract and create a contractagreement if available
if (email) { ContractAgreementListActions.createContractAgreementFromPublicContract(email);
// fetch the available contractagreements (pending/accepted)
ContractAgreementListActions.fetchAvailableContractAgreementList(email).then(
(contractAgreementList) => {
if (!contractAgreementList && this.props.createPublicContractAgreement) {
// for public contracts: fetch the public contract and create a contractagreement if available
ContractAgreementListActions.createContractAgreementFromPublicContract(email);
}
} }
); }
}}, 0); );
}
}, },
getFormData(){ getFormData(){