mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 10:25:08 +01:00
Merge pull request #70 from ascribe/fix-polyfill-import
Fix polyfill import
This commit is contained in:
commit
0da3891d51
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('babel/polyfill');
|
import polyfill from 'babel/polyfill';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Router, Redirect } from 'react-router';
|
import { Router, Redirect } from 'react-router';
|
||||||
|
27
js/sources/coa_source.js
Normal file
27
js/sources/coa_source.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import requests from '../utils/requests';
|
||||||
|
|
||||||
|
import EditionActions from '../actions/edition_actions';
|
||||||
|
|
||||||
|
|
||||||
|
const CoaSource = {
|
||||||
|
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 CoaSource;
|
@ -13,25 +13,7 @@ const EditionSource = {
|
|||||||
|
|
||||||
success: EditionActions.successFetchEdition,
|
success: EditionActions.successFetchEdition,
|
||||||
error: EditionActions.errorEdition
|
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;
|
export default EditionSource;
|
@ -5,6 +5,9 @@ import { alt } from '../alt';
|
|||||||
import EditionActions from '../actions/edition_actions';
|
import EditionActions from '../actions/edition_actions';
|
||||||
|
|
||||||
import EditionSource from '../sources/edition_source';
|
import EditionSource from '../sources/edition_source';
|
||||||
|
import CoaSource from '../sources/coa_source';
|
||||||
|
|
||||||
|
import { mergeOptions } from '../utils/general_utils';
|
||||||
|
|
||||||
|
|
||||||
class EditionStore {
|
class EditionStore {
|
||||||
@ -19,7 +22,7 @@ class EditionStore {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.bindActions(EditionActions);
|
this.bindActions(EditionActions);
|
||||||
this.registerAsync(EditionSource);
|
this.registerAsync(mergeOptions(EditionSource, CoaSource));
|
||||||
}
|
}
|
||||||
|
|
||||||
onFetchEdition(idToFetch) {
|
onFetchEdition(idToFetch) {
|
||||||
|
Loading…
Reference in New Issue
Block a user