1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00
onion/js/actions/edition_list_actions.js
2015-05-29 09:20:01 +02:00

28 lines
680 B
JavaScript

import alt from '../alt';
import EditionListFetcher from '../fetchers/edition_list_fetcher.js';
class EditionListActions {
constructor() {
this.generateActions(
'updateEditionList',
'selectEdition'
);
}
fetchEditionList(pieceId) {
EditionListFetcher
.fetch(pieceId)
.then((res) => {
this.actions.updateEditionList({
'editionListOfPiece': res.editions,
pieceId
});
})
.catch((err) => {
console.log(err);
});
}
}
export default alt.createActions(EditionListActions);