1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 18:13:49 +01:00
onion/js/actions/edition_actions.js

26 lines
529 B
JavaScript
Raw Normal View History

'use strict';
import alt from '../alt';
2015-05-26 13:48:46 +02:00
import EditionFetcher from '../fetchers/edition_fetcher';
2015-05-26 13:48:46 +02:00
class EditionActions {
constructor() {
this.generateActions(
2015-05-26 13:48:46 +02:00
'updateEdition'
);
}
2015-05-26 13:48:46 +02:00
fetchOne(editionId) {
EditionFetcher.fetchOne(editionId)
.then((res) => {
2015-05-26 13:48:46 +02:00
this.actions.updateEdition(res.edition);
})
.catch((err) => {
2015-05-26 16:46:02 +02:00
console.log(err);
});
}
}
2015-05-26 13:48:46 +02:00
export default alt.createActions(EditionActions);