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