fetch next actions from wiaas plugin
This commit is contained in:
@@ -1,4 +1,8 @@
|
|||||||
import {REQUEST_NEXT_ACTIONS, RECIEVE_NEXT_ACTIONS} from '../../constants/dashboardConstants';
|
import {REQUEST_NEXT_ACTIONS, RECIEVE_NEXT_ACTIONS} from '../../constants/dashboardConstants';
|
||||||
|
import { API_SERVER } from '../../config';
|
||||||
|
import HtmlClient from '../../helpers/HtmlClient';
|
||||||
|
|
||||||
|
const client = new HtmlClient();
|
||||||
|
|
||||||
export const requestNextActions = () => ({
|
export const requestNextActions = () => ({
|
||||||
type: REQUEST_NEXT_ACTIONS,
|
type: REQUEST_NEXT_ACTIONS,
|
||||||
@@ -14,16 +18,12 @@ export const recieveNextActions = (json) => ({
|
|||||||
export const fetchNextActions = () => {
|
export const fetchNextActions = () => {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch(requestNextActions());
|
dispatch(requestNextActions());
|
||||||
//TODO : fetch next actions from gravity flow api
|
|
||||||
dispatch(recieveNextActions({}));
|
|
||||||
/*
|
|
||||||
return client.fetch({
|
return client.fetch({
|
||||||
url: `${API_SERVER}/dashboards/api/getNextActionsInfo`
|
url: `${API_SERVER}/wp-json/wiaas/next-delivery-steps`
|
||||||
})
|
})
|
||||||
.then(response => dispatch(recieveNextActions(response.data)))
|
.then(response => dispatch(recieveNextActions(response.data)))
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
client.onError(error, dispatch);
|
client.onError(error, dispatch);
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user