Fix the issue where useSettings does not work in SSR mode.

This commit is contained in:
Rafi
2023-04-06 16:07:46 +08:00
parent 82c1811034
commit 8a9b705b99
5 changed files with 23 additions and 20 deletions

View File

@@ -53,14 +53,14 @@ const transformData = (list) => {
return result;
}
export const getSystemSettings = async () => {
export const fetchSystemSettings = async () => {
const { data, error } = await useAuthFetch('/api/chat/settings/', {
method: 'GET',
})
if (!error.value) {
return transformData(data.value)
const settings = useSettings()
settings.value = transformData(data.value)
}
return {}
}
export const fetchUser = async () => {