2015-05-21 17:59:38 +02:00
|
|
|
import alt from '../alt';
|
|
|
|
|
|
|
|
import EditionListFetcher from '../fetchers/edition_list_fetcher.js';
|
|
|
|
|
|
|
|
class EditionListActions {
|
|
|
|
constructor() {
|
|
|
|
this.generateActions(
|
2015-05-26 16:48:48 +02:00
|
|
|
'updateEditionList',
|
|
|
|
'selectEdition'
|
2015-05-21 17:59:38 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-05-22 18:41:15 +02:00
|
|
|
fetchEditionList(pieceId) {
|
2015-05-21 17:59:38 +02:00
|
|
|
EditionListFetcher
|
2015-05-22 16:51:08 +02:00
|
|
|
.fetch(pieceId)
|
2015-05-21 17:59:38 +02:00
|
|
|
.then((res) => {
|
2015-05-26 13:14:35 +02:00
|
|
|
this.actions.updateEditionList({
|
2015-05-26 16:48:48 +02:00
|
|
|
'editionListOfPiece': res.editions,
|
2015-05-26 13:14:35 +02:00
|
|
|
pieceId
|
|
|
|
});
|
2015-05-21 17:59:38 +02:00
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
console.log(err);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default alt.createActions(EditionListActions);
|