diff --git a/web-new/src/api/index.tsx b/web-new/src/api/index.tsx index 112945209..b2aa97a08 100644 --- a/web-new/src/api/index.tsx +++ b/web-new/src/api/index.tsx @@ -20,8 +20,10 @@ export function ApiProvider({ children, options }: ApiProviderType) { return ( - axios.get(path, { params }).then((res) => res.data), + fetcher: (key) => { + const [path, params] = Array.isArray(key) ? key : [key, undefined]; + return axios.get(path, { params }).then((res) => res.data); + }, ...options, }} >