mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
38 lines
907 B
JavaScript
38 lines
907 B
JavaScript
'use strict';
|
|
|
|
import requests from '../utils/requests';
|
|
|
|
import EditionActions from '../actions/edition_actions';
|
|
|
|
|
|
const EditionSource = {
|
|
lookupEdition: {
|
|
remote(state) {
|
|
return requests.get('edition', { bitcoin_id: state.editionMeta.idToFetch });
|
|
},
|
|
|
|
success: EditionActions.successFetchEdition,
|
|
error: EditionActions.errorEdition
|
|
},
|
|
|
|
// For COA
|
|
lookupCoa: {
|
|
remote(state) {
|
|
return requests.get('coa', { id: state.edition.coa });
|
|
},
|
|
|
|
success: EditionActions.successFetchCoa,
|
|
error: EditionActions.errorCoa
|
|
},
|
|
|
|
performCreateCoa: {
|
|
remote(state) {
|
|
return requests.post('coa_create', {body: { bitcoin_id: state.edition.bitcoin_id }});
|
|
},
|
|
success: EditionActions.successFetchCoa,
|
|
error: EditionActions.errorCoa
|
|
}
|
|
};
|
|
|
|
export default EditionSource;
|