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

24 lines
514 B
JavaScript
Raw Normal View History

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);