diff --git a/js/actions/contract_list_actions.js b/js/actions/contract_list_actions.js index aaee33c6..5248203f 100644 --- a/js/actions/contract_list_actions.js +++ b/js/actions/contract_list_actions.js @@ -44,8 +44,12 @@ class ContractListActions { resolve(res); }) .catch( (err) => { - console.logGlobal(err); - reject(err); + if(typeof err === 'undefined') { + resolve(err); + } + else{ + reject(err); + } }); }); } diff --git a/js/fetchers/ownership_fetcher.js b/js/fetchers/ownership_fetcher.js index e9ca4e50..02990f3a 100644 --- a/js/fetchers/ownership_fetcher.js +++ b/js/fetchers/ownership_fetcher.js @@ -24,7 +24,8 @@ let OwnershipFetcher = { }, makeContractPublic(contractObj){ - return requests.put('ownership_contract', { body: contractObj, contract_id: contractObj.id }); + console.log(ApiUrls.ownership_contract); + return requests.put(ApiUrls.ownership_contract, { body: contractObj, contract_id: contractObj.id }); }, deleteContract(contractObjId){ diff --git a/js/utils/requests.js b/js/utils/requests.js index 720f184f..459cd480 100644 --- a/js/utils/requests.js +++ b/js/utils/requests.js @@ -116,7 +116,6 @@ class Requests { merged.headers['X-CSRFToken'] = csrftoken; } merged.method = verb; - return fetch(url, merged) .then(this.unpackResponse) .catch( () => { @@ -136,14 +135,12 @@ class Requests { delete(url, params) { let paramsCopy = this._merge(params); let newUrl = this.prepareUrl(url, paramsCopy, true); - return this.request('delete', newUrl); } _putOrPost(url, paramsAndBody, method){ let paramsCopy = this._merge(paramsAndBody); let params = excludePropFromObject(paramsAndBody, ['body']); - let newUrl = this.prepareUrl(url, params); let body = null; if (paramsCopy && paramsCopy.body) {