import { AxiosError, Method } from 'axios' import { URLSearchParams } from 'url' import { GridDto } from '../proxy/form/models' import apiService from './api.service' export const getList = (data: Record) => { try { return apiService.fetchData({ method: 'GET', url: '/api/app/list-form-select/grid', params: data, }) } catch (error) { if (error instanceof AxiosError) { return error.response?.data } } } export const dynamicFetch = ( url: string, method: Method | string, params?: URLSearchParams | any, data?: any, ) => { try { return apiService.fetchData({ method, url: '/api/app/' + url, params, data, }) } catch (error) { if (error instanceof AxiosError) { return error.response?.data } } }