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());
|
2018-07-29 02:28:44 +02:00
|
|
|
//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-07-29 02:28:44 +02:00
|
|
|
*/
|
2018-06-14 16:49:28 +02:00
|
|
|
}
|
|
|
|
|
}
|