1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 13:41:57 +02:00
onion/js/actions/edition_actions.js

26 lines
535 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-07-17 15:41:09 +02:00
console.logGlobal(err);
});
}
}
2015-05-26 13:48:46 +02:00
export default alt.createActions(EditionActions);