2025-05-06 06:45:49 +00:00
|
|
|
import { AxiosError } from 'axios'
|
2025-08-12 08:39:06 +00:00
|
|
|
import apiService from './api.service'
|
2025-08-12 09:39:09 +00:00
|
|
|
import { MainGroupedSettingDto } from '@/proxy/settings/models'
|
2025-05-06 06:45:49 +00:00
|
|
|
|
|
|
|
|
export const getList = () =>
|
|
|
|
|
apiService.fetchData<MainGroupedSettingDto[]>({
|
|
|
|
|
method: 'GET',
|
|
|
|
|
url: '/api/app/setting-ui',
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
export const updateSettingValues = async (settingValues: Record<string, string>) => {
|
|
|
|
|
try {
|
|
|
|
|
return await apiService.fetchData<void, Record<string, string>>({
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
url: '/api/app/setting-ui/setting-values',
|
|
|
|
|
data: settingValues,
|
|
|
|
|
})
|
|
|
|
|
} catch (error) {
|
|
|
|
|
if (error instanceof AxiosError) {
|
|
|
|
|
return error.response?.data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|