1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

remove debugged 204 no response comes as error, handled gracefully

This commit is contained in:
Cevo 2015-09-08 13:08:49 +02:00
parent 5b0cbc92ad
commit 3e1b362cc0
3 changed files with 8 additions and 6 deletions

View File

@ -44,8 +44,12 @@ class ContractListActions {
resolve(res); resolve(res);
}) })
.catch( (err) => { .catch( (err) => {
console.logGlobal(err); if(typeof err === 'undefined') {
resolve(err);
}
else{
reject(err); reject(err);
}
}); });
}); });
} }

View File

@ -24,7 +24,8 @@ let OwnershipFetcher = {
}, },
makeContractPublic(contractObj){ 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){ deleteContract(contractObjId){

View File

@ -116,7 +116,6 @@ class Requests {
merged.headers['X-CSRFToken'] = csrftoken; merged.headers['X-CSRFToken'] = csrftoken;
} }
merged.method = verb; merged.method = verb;
return fetch(url, merged) return fetch(url, merged)
.then(this.unpackResponse) .then(this.unpackResponse)
.catch( () => { .catch( () => {
@ -136,14 +135,12 @@ class Requests {
delete(url, params) { delete(url, params) {
let paramsCopy = this._merge(params); let paramsCopy = this._merge(params);
let newUrl = this.prepareUrl(url, paramsCopy, true); let newUrl = this.prepareUrl(url, paramsCopy, true);
return this.request('delete', newUrl); return this.request('delete', newUrl);
} }
_putOrPost(url, paramsAndBody, method){ _putOrPost(url, paramsAndBody, method){
let paramsCopy = this._merge(paramsAndBody); let paramsCopy = this._merge(paramsAndBody);
let params = excludePropFromObject(paramsAndBody, ['body']); let params = excludePropFromObject(paramsAndBody, ['body']);
let newUrl = this.prepareUrl(url, params); let newUrl = this.prepareUrl(url, params);
let body = null; let body = null;
if (paramsCopy && paramsCopy.body) { if (paramsCopy && paramsCopy.body) {