Last active
January 9, 2018 00:27
-
-
Save l0gicgate/f522a26b2a2a86c8419da4b331d24566 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import ReactFlux from 'react-flux'; | |
import './index.css'; | |
import AppForm from './react-components/AppForm'; | |
import registerServiceWorker from './registerServiceWorker'; | |
import axios from 'axios'; | |
function getApplications() { | |
return axios.get('/api/applications').then(x => x.data); | |
} | |
function getMethodsData() { | |
return axios.get('/api/applications/data', { | |
params: { | |
command: 'get-form-options', | |
data: 'app-methods' | |
} | |
}).then(x => x.data); | |
} | |
function getStatusesData() { | |
return axios.get('/api/applications/data', { | |
params: { | |
command: 'get-form-options', | |
data: 'app-statuses' | |
} | |
}).then(x => x.data); | |
} | |
axios.all([getApplications(), getMethodsData(), getStatusesData()]) | |
.then(axios.spread((applications, methods, statuses) => { | |
ReactDOM.render(( | |
<AppForm | |
applications={applications} | |
methods={methods} | |
statuses={statuses} | |
/> | |
), document.getElementById('applist')); | |
})); | |
//registerServiceWorker(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment