2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
|
|
|
|
2015-07-02 11:54:33 +02:00
|
|
|
import requests from '../utils/requests';
|
2015-06-01 13:02:53 +02:00
|
|
|
|
2015-07-15 14:48:51 +02:00
|
|
|
import ApiUrls from '../constants/api_urls';
|
2015-06-01 13:02:53 +02:00
|
|
|
|
|
|
|
let OwnershipFetcher = {
|
|
|
|
/**
|
2015-08-28 16:18:10 +02:00
|
|
|
* Fetch the default, public contract of a user from the API.
|
2015-06-01 13:02:53 +02:00
|
|
|
*/
|
2015-08-28 16:18:10 +02:00
|
|
|
fetchContract(email) {
|
|
|
|
return requests.get(ApiUrls.ownership_contract + '?loanee=' + email);
|
2015-08-18 16:24:36 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fetch the contracts of the logged-in user from the API.
|
|
|
|
*/
|
2015-08-28 16:18:10 +02:00
|
|
|
fetchContractList(){
|
|
|
|
return requests.get(ApiUrls.ownership_contract);
|
2015-08-26 09:50:38 +02:00
|
|
|
},
|
2015-08-18 16:24:36 +02:00
|
|
|
|
2015-08-26 09:50:38 +02:00
|
|
|
fetchLoanPieceRequestList(){
|
|
|
|
return requests.get(ApiUrls.ownership_loans_pieces_request);
|
|
|
|
}
|
2015-06-01 13:02:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default OwnershipFetcher;
|