You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
420 B

  1. import axios from 'axios';
  2. export const SETTING_CHANGE = 'SETTING_CHANGE';
  3. export function changeSetting(key, value) {
  4. return dispatch => {
  5. dispatch({
  6. type: SETTING_CHANGE,
  7. key,
  8. value,
  9. });
  10. dispatch(saveSettings());
  11. };
  12. };
  13. export function saveSettings() {
  14. return (_, getState) => {
  15. axios.put('/api/web/settings', {
  16. data: getState().get('settings').toJS(),
  17. });
  18. };
  19. };