mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 09:35:10 +01:00
ab97fa420c
shortlist on accordeonlist OK
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
'use strict';
|
|
|
|
import alt from '../alt';
|
|
import OwnershipFetcher from '../fetchers/ownership_fetcher';
|
|
|
|
|
|
class OwnershipActions {
|
|
constructor() {
|
|
this.generateActions(
|
|
'updateLoanPieceRequestList',
|
|
'updateLoanPieceRequest',
|
|
'flushLoanPieceRequest'
|
|
);
|
|
}
|
|
|
|
fetchLoanRequestList() {
|
|
OwnershipFetcher.fetchLoanPieceRequestList()
|
|
.then((data) => {
|
|
this.actions.updateLoanPieceRequestList(data.loan_requests);
|
|
})
|
|
.catch((err) => {
|
|
console.logGlobal(err);
|
|
this.actions.updateLoanPieceRequestList(null);
|
|
});
|
|
}
|
|
|
|
fetchLoanRequest(pieceId) {
|
|
OwnershipFetcher.fetchLoanPieceRequestList()
|
|
.then((data) => {
|
|
this.actions.updateLoanPieceRequest({loanRequests: data.loan_requests, pieceId: pieceId});
|
|
})
|
|
.catch((err) => {
|
|
console.logGlobal(err);
|
|
});
|
|
}
|
|
}
|
|
|
|
export default alt.createActions(OwnershipActions);
|