mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
28 lines
737 B
JavaScript
28 lines
737 B
JavaScript
import alt from '../alt';
|
|
import PieceListFetcher from '../fetchers/piece_list_fetcher';
|
|
|
|
|
|
class PieceListActions {
|
|
constructor() {
|
|
this.generateActions(
|
|
'updatePieceList'
|
|
);
|
|
}
|
|
|
|
fetchList(page, pageSize, search, orderBy, orderAsc) {
|
|
PieceListFetcher.fetch(page, pageSize, search, orderBy, orderAsc)
|
|
.then((res) => {
|
|
this.actions.updatePieceList({
|
|
'itemList': res.pieces,
|
|
'orderBy': orderBy,
|
|
'orderAsc': orderAsc
|
|
});
|
|
})
|
|
.catch((err) => {
|
|
console.log(err);
|
|
});
|
|
}
|
|
};
|
|
|
|
export default alt.createActions(PieceListActions);
|