initial docker setup
This commit is contained in:
28
frontend/src/actions/dashboard/nextActionsActions.js
Normal file
28
frontend/src/actions/dashboard/nextActionsActions.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import {API_SERVER} from '../../config';
|
||||
import HtmlClient from '../../helpers/HtmlClient';
|
||||
import {REQUEST_NEXT_ACTIONS, RECIEVE_NEXT_ACTIONS} from '../../constants/dashboardConstants';
|
||||
const client = new HtmlClient();
|
||||
|
||||
export const requestNextActions = () => ({
|
||||
type: REQUEST_NEXT_ACTIONS,
|
||||
isLoading: true
|
||||
});
|
||||
|
||||
export const recieveNextActions = (json) => ({
|
||||
type: RECIEVE_NEXT_ACTIONS,
|
||||
isLoading: false,
|
||||
nextActions: json
|
||||
});
|
||||
|
||||
export const fetchNextActions = () => {
|
||||
return dispatch => {
|
||||
dispatch(requestNextActions());
|
||||
return client.fetch({
|
||||
url: `${API_SERVER}/dashboards/api/getNextActionsInfo`
|
||||
})
|
||||
.then(response => dispatch(recieveNextActions(response.data)))
|
||||
.catch(error => {
|
||||
client.onError(error, dispatch);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user