diff --git a/js/actions/contract_list_actions.js b/js/actions/contract_list_actions.js
index 307706ef..60144ef6 100644
--- a/js/actions/contract_list_actions.js
+++ b/js/actions/contract_list_actions.js
@@ -23,8 +23,7 @@ class ContractListActions {
});
}
- makeContractPublic(contract){
- contract.public = true;
+ changeContract(contract){
return Q.Promise((resolve, reject) => {
OwnershipFetcher.makeContractPublic(contract)
.then((res) => {
@@ -41,11 +40,9 @@ class ContractListActions {
return Q.Promise((resolve, reject) => {
OwnershipFetcher.deleteContract(contractId)
.then((res) => {
- console.log('Contract deleted');
resolve(res);
})
.catch( (err) => {
- console.log('Error while deleting');
console.logGlobal(err);
reject(err);
});
diff --git a/js/components/ascribe_settings/contract_settings.js b/js/components/ascribe_settings/contract_settings.js
index e34772f2..c48ca0d7 100644
--- a/js/components/ascribe_settings/contract_settings.js
+++ b/js/components/ascribe_settings/contract_settings.js
@@ -39,10 +39,11 @@ let ContractSettings = React.createClass({
makeContractPublic(contract) {
return () => {
- ContractListActions.makeContractPublic(contract)
+ contract.public = true;
+ ContractListActions.changeContract(contract)
.then(() => ContractListActions.fetchContractList())
- .catch((error) => {
- let notification = new GlobalNotificationModel(error, 'success', 10000);
+ .catch((err) => {
+ let notification = new GlobalNotificationModel(err, 'danger', 10000);
GlobalNotificationActions.appendGlobalNotification(notification);
});
};
@@ -52,8 +53,8 @@ let ContractSettings = React.createClass({
return () => {
ContractListActions.removeContract(contract.id)
.then(( ) => ContractListActions.fetchContractList())
- .catch((error) => {
- let notification = new GlobalNotificationModel(error, 'danger', 10000);
+ .catch((err) => {
+ let notification = new GlobalNotificationModel(err, 'danger', 10000);
GlobalNotificationActions.appendGlobalNotification(notification);
});
};
@@ -95,8 +96,9 @@ let ContractSettings = React.createClass({
-