From 632c04149dde6b38c9c07f9fef803c90f86f707c Mon Sep 17 00:00:00 2001 From: Cevo Date: Mon, 7 Sep 2015 15:43:44 +0200 Subject: [PATCH] tabs inserted in jsx --- js/actions/contract_list_actions.js | 4 +- .../ascribe_settings/contract_settings.js | 42 ++++++++++++------- js/fetchers/ownership_fetcher.js | 4 +- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/js/actions/contract_list_actions.js b/js/actions/contract_list_actions.js index 7df5d549..307706ef 100644 --- a/js/actions/contract_list_actions.js +++ b/js/actions/contract_list_actions.js @@ -37,9 +37,9 @@ class ContractListActions { }); } - removeContract(contract){ + removeContract(contractId){ return Q.Promise((resolve, reject) => { - OwnershipFetcher.deleteContract(contract) + OwnershipFetcher.deleteContract(contractId) .then((res) => { console.log('Contract deleted'); resolve(res); diff --git a/js/components/ascribe_settings/contract_settings.js b/js/components/ascribe_settings/contract_settings.js index 919c1960..880cd744 100644 --- a/js/components/ascribe_settings/contract_settings.js +++ b/js/components/ascribe_settings/contract_settings.js @@ -32,21 +32,21 @@ let ContractSettings = React.createClass({ this.setState(state); }, makeContractPublic(contract){ - console.log(contract); ContractListActions.makeContractPublic(contract) .then(( ) => ContractListActions.fetchContractList()) .catch((error)=>{ - let notification = new GlobalNotificationModel(error, 'danger', 10000); - GlobalNotificationActions.appendGlobalNotification(notification); + let notification = new GlobalNotificationModel(error, 'danger', 10000); + GlobalNotificationActions.appendGlobalNotification(notification); }); }, removeContract(contract){ console.log(contract); - ContractListActions.removeContract(contract) + ContractListActions.removeContract(contract.id) .then(( ) => ContractListActions.fetchContractList()) - .catch((error) => {console.log('Error', error); - let notification = new GlobalNotificationModel(error, 'danger', 10000); - GlobalNotificationActions.appendGlobalNotification(notification); + .catch((error) => { + console.log('Error', error); + let notification = new GlobalNotificationModel(error, 'danger', 10000); + GlobalNotificationActions.appendGlobalNotification(notification); }); }, getPublicContracts(){ @@ -81,9 +81,13 @@ let ContractSettings = React.createClass({ - - + + } />); } @@ -98,11 +102,19 @@ let ContractSettings = React.createClass({ return ( - - } + buttons = { + + + + } />); } ) : null} diff --git a/js/fetchers/ownership_fetcher.js b/js/fetchers/ownership_fetcher.js index e698e199..07b37bf5 100644 --- a/js/fetchers/ownership_fetcher.js +++ b/js/fetchers/ownership_fetcher.js @@ -27,8 +27,8 @@ let OwnershipFetcher = { return requests.put('ownership_csontract', { body: contractObj, contract_id: contractObj.id }); }, - deleteContract(contractObj){ - return requests.delete('ownership_contract', {body: contractObj, contract_id: contractObj.id}); + deleteContract(contractObjId){ + return requests.delete('ownership_contract', {contract_id: contractObjId}); } };