erp-platform/ui/src/services/setting-ui.service.ts

24 lines
648 B
TypeScript
Raw Normal View History

2025-05-06 06:45:49 +00:00
import { AxiosError } from 'axios'
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
}
}
}