mirror of
https://github.com/alice-lg/alice-lg.git
synced 2024-05-11 05:55:03 +00:00
22 lines
475 B
JavaScript
22 lines
475 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));
|
|
})
|
|
.catch(error => dispatch(apiError(error)));
|
|
}
|
|
}
|