mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 01:25:17 +01:00
35 lines
867 B
JavaScript
35 lines
867 B
JavaScript
import alt from '../alt';
|
|
|
|
import PieceListFetcher from '../fetchers/piece_list_fetcher';
|
|
|
|
|
|
class PieceListActions {
|
|
constructor() {
|
|
this.generateActions(
|
|
'updatePieceList'
|
|
);
|
|
}
|
|
|
|
fetchPieceList(page, pageSize, search, orderBy, orderAsc) {
|
|
PieceListFetcher
|
|
.fetch(page, pageSize, search, orderBy, orderAsc)
|
|
.then((res) => {
|
|
this.actions.updatePieceList({
|
|
page,
|
|
pageSize,
|
|
search,
|
|
orderBy,
|
|
orderAsc,
|
|
'pieceList': res.pieces,
|
|
'pieceListCount': res.count
|
|
});
|
|
})
|
|
.catch((err) => {
|
|
console.log(err);
|
|
});
|
|
}
|
|
|
|
};
|
|
|
|
export default alt.createActions(PieceListActions);
|