Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
Add Comment
Please, Sign In to add comment