Rename key to path in actions and reducers for settings (#6105)

This commit is contained in:
Akihiko Odaki 2018-01-02 21:50:54 +09:00 committed by Eugen Rochko
parent ce854ed506
commit 3ba7cde38d
7 changed files with 15 additions and 15 deletions

View file

@ -4,11 +4,11 @@ import { debounce } from 'lodash';
export const SETTING_CHANGE = 'SETTING_CHANGE';
export const SETTING_SAVE = 'SETTING_SAVE';
export function changeSetting(key, value) {
export function changeSetting(path, value) {
return dispatch => {
dispatch({
type: SETTING_CHANGE,
key,
path,
value,
});
@ -21,7 +21,7 @@ const debouncedSave = debounce((dispatch, getState) => {
return;
}
const data = getState().get('settings').filter((_, key) => key !== 'saved').toJS();
const data = getState().get('settings').filter((_, path) => path !== 'saved').toJS();
axios.put('/api/web/settings', { data }).then(() => dispatch({ type: SETTING_SAVE }));
}, 5000, { trailing: true });