about summary refs log tree commit diff
path: root/app/javascript/mastodon/actions/settings.js
diff options
context:
space:
mode:
authornightpool <eg1290@gmail.com>2018-01-08 14:01:33 -0500
committerEugen Rochko <eugen@zeonfederated.com>2018-01-08 20:01:33 +0100
commitc235711ffee6999c09bd6910373ebcfbc7758e99 (patch)
tree40efb018ab3fdc58d933d5ef09a95c56f0ef298d /app/javascript/mastodon/actions/settings.js
parentff6ca8bdc6e4ae42c571fecbab8ddc8817638c31 (diff)
Refactor /api/web APIs to use the centralized axios instance (#6223)
Also adds the ability to decouple the centralized axios logic from the
state dispatcher
Diffstat (limited to 'app/javascript/mastodon/actions/settings.js')
-rw-r--r--app/javascript/mastodon/actions/settings.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/actions/settings.js b/app/javascript/mastodon/actions/settings.js
index aeef43527..b96383daa 100644
--- a/app/javascript/mastodon/actions/settings.js
+++ b/app/javascript/mastodon/actions/settings.js
@@ -1,4 +1,4 @@
-import axios from 'axios';
+import api from '../api';
 import { debounce } from 'lodash';
 
 export const SETTING_CHANGE = 'SETTING_CHANGE';
@@ -23,7 +23,7 @@ const debouncedSave = debounce((dispatch, getState) => {
 
   const data = getState().get('settings').filter((_, path) => path !== 'saved').toJS();
 
-  axios.put('/api/web/settings', { data }).then(() => dispatch({ type: SETTING_SAVE }));
+  api(getState).put('/api/web/settings', { data }).then(() => dispatch({ type: SETTING_SAVE }));
 }, 5000, { trailing: true });
 
 export function saveSettings() {