19 lines
819 B
JavaScript
19 lines
819 B
JavaScript
import {API_SERVER} from '../../config';
|
|
import HtmlClient from '../../helpers/HtmlClient';
|
|
import {REQUEST_GADGETS, RECIEVE_GADGETS} from '../../constants/dashboardConstants';
|
|
const htmlClient = new HtmlClient();
|
|
|
|
const requestGadgets = () => ({type: REQUEST_GADGETS});
|
|
const recieveGadgets = (json) => ({
|
|
type: RECIEVE_GADGETS,
|
|
gadgets: json
|
|
});
|
|
|
|
export const fetchGadgets = () => {
|
|
return dispatch => {
|
|
dispatch(requestGadgets());
|
|
const data = {"info":{"idDashboard":"23","name":"Customer Basic Dashboard","isOwner":"0"},"gadgets":[{"idGadget":"3","name":"Customer Order Central","module":"gadget-order-central","position":"1"},{"idGadget":"5","name":"Customer Next Actions","module":"gadget-next-actions","position":"2"}]};
|
|
dispatch(recieveGadgets(data.gadgets))
|
|
}
|
|
}
|