mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
29 lines
721 B
JavaScript
29 lines
721 B
JavaScript
import alt from '../alt';
|
|
|
|
import EditionListFetcher from '../fetchers/edition_list_fetcher.js';
|
|
|
|
class EditionListActions {
|
|
constructor() {
|
|
this.generateActions(
|
|
'updateEditionList',
|
|
'selectEdition',
|
|
'clearAllEditionSelections'
|
|
);
|
|
}
|
|
|
|
fetchEditionList(pieceId) {
|
|
EditionListFetcher
|
|
.fetch(pieceId)
|
|
.then((res) => {
|
|
this.actions.updateEditionList({
|
|
'editionListOfPiece': res.editions,
|
|
pieceId
|
|
});
|
|
})
|
|
.catch((err) => {
|
|
console.log(err);
|
|
});
|
|
}
|
|
}
|
|
|
|
export default alt.createActions(EditionListActions); |