1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00
onion/js/actions/edition_actions.js
2015-10-19 15:29:57 +02:00

28 lines
622 B
JavaScript

'use strict';
import { alt } from '../alt';
import EditionFetcher from '../fetchers/edition_fetcher';
class EditionActions {
constructor() {
this.generateActions(
'updateEdition',
'editionFailed'
);
}
fetchOne(editionId) {
EditionFetcher.fetchOne(editionId)
.then((res) => {
this.actions.updateEdition(res.edition);
})
.catch((err) => {
console.logGlobal(err);
this.actions.editionFailed(err.json);
});
}
}
export default alt.createActions(EditionActions);