mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-08 04:05:26 +03:00
SWRConfig changes for swr 2.x
This commit is contained in:
parent
7cf04db975
commit
77a0eb41be
@ -20,8 +20,10 @@ export function ApiProvider({ children, options }: ApiProviderType) {
|
||||
return (
|
||||
<SWRConfig
|
||||
value={{
|
||||
fetcher: (path, params) =>
|
||||
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,
|
||||
}}
|
||||
>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user