18 lines
663 B
JavaScript
18 lines
663 B
JavaScript
import api from '../api';
|
|
|
|
export const ADMIN_CONFIG_UPDATE_REQUEST = 'ADMIN_CONFIG_UPDATE_REQUEST';
|
|
export const ADMIN_CONFIG_UPDATE_SUCCESS = 'ADMIN_CONFIG_UPDATE_SUCCESS';
|
|
export const ADMIN_CONFIG_UPDATE_FAIL = 'ADMIN_CONFIG_UPDATE_FAIL';
|
|
|
|
export function updateAdminConfig(params) {
|
|
return (dispatch, getState) => {
|
|
dispatch({ type: ADMIN_CONFIG_UPDATE_REQUEST });
|
|
return api(getState)
|
|
.post('/api/pleroma/admin/config', params)
|
|
.then(response => {
|
|
dispatch({ type: ADMIN_CONFIG_UPDATE_SUCCESS, config: response.data });
|
|
}).catch(error => {
|
|
dispatch({ type: ADMIN_CONFIG_UPDATE_FAIL, error });
|
|
});
|
|
};
|
|
}
|