Files
old-new-wiaas/frontend/src/actions/dashboard/nextActionsActions.js

30 lines
857 B
JavaScript
Raw Normal View History

2018-06-14 16:49:28 +02:00
import {REQUEST_NEXT_ACTIONS, RECIEVE_NEXT_ACTIONS} from '../../constants/dashboardConstants';
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());
//TODO : fetch next actions from gravity flow api
dispatch(recieveNextActions({}));
/*
2018-06-14 16:49:28 +02:00
return client.fetch({
url: `${API_SERVER}/dashboards/api/getNextActionsInfo`
})
.then(response => dispatch(recieveNextActions(response.data)))
.catch(error => {
client.onError(error, dispatch);
});
*/
2018-06-14 16:49:28 +02:00
}
}