1
0
mirror of https://github.com/alice-lg/alice-lg.git synced 2024-05-11 05:55:03 +00:00
2018-10-18 11:50:54 +02:00

23 lines
485 B
JavaScript

import axios from 'axios';
import {apiError} from 'components/errors/actions'
export const LOAD_CONFIG_SUCCESS = "@config/LOAD_CONFIG_SUCCESS";
function loadConfigSuccess(config) {
return {
type: LOAD_CONFIG_SUCCESS,
payload: config
};
}
export function loadConfig() {
return (dispatch) => {
axios.get(`/api/v1/config`)
.then(
({data}) => {
dispatch(loadConfigSuccess(data));
},
(error) => dispatch(apiError(error)));
}
}