0
0
Fork 0
salix-front-mindshore-fork2/src/composables/useUserConfig.js

18 lines
388 B
JavaScript
Raw Normal View History

2023-05-11 06:55:34 +00:00
import axios from 'axios';
import { useState } from './useState';
2023-05-11 06:55:34 +00:00
export function useUserConfig() {
const state = useState();
2023-05-11 06:55:34 +00:00
async function fetch() {
const { data } = await axios.get('UserConfigs/getUserConfig');
const user = state.getUser().value;
user.darkMode = data.darkMode;
state.setUser(user);
2023-05-11 06:55:34 +00:00
}
return {
fetch,
};
}