1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00
onion/js/fetchers/ownership_fetcher.js
Tim Daubenschütz 8a75e94413 fix bug
2015-09-04 16:24:29 +02:00

32 lines
787 B
JavaScript

'use strict';
import requests from '../utils/requests';
import ApiUrls from '../constants/api_urls';
let OwnershipFetcher = {
/**
* Fetch the default, public contract of a user from the API.
*/
fetchContract(email) {
return requests.get(ApiUrls.blob_contracts + '?loanee=' + email);
},
/**
* Fetch the contracts of the logged-in user from the API.
*/
fetchContractList(){
return requests.get(ApiUrls.ownership_contract_list);
},
fetchLoanPieceRequestList(){
return requests.get(ApiUrls.ownership_loans_pieces_request);
},
makeContractPublic(contractObj){
return requests.put('ownership_contract', { body: contractObj, contract_id: contractObj.id });
}
};
export default OwnershipFetcher;