1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00
onion/js/actions/piece_list_actions.js

36 lines
858 B
JavaScript

'use strict';
import alt from '../alt';
import PieceListFetcher from '../fetchers/piece_list_fetcher';
class PieceListActions {
constructor() {
this.generateActions(
'updatePieceList',
'showEditionList',
'closeAllEditionLists'
);
}
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
});
});
}
}
export default alt.createActions(PieceListActions);