mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 19:55: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 (
|
return (
|
||||||
<SWRConfig
|
<SWRConfig
|
||||||
value={{
|
value={{
|
||||||
fetcher: (path, params) =>
|
fetcher: (key) => {
|
||||||
axios.get(path, { params }).then((res) => res.data),
|
const [path, params] = Array.isArray(key) ? key : [key, undefined];
|
||||||
|
return axios.get(path, { params }).then((res) => res.data);
|
||||||
|
},
|
||||||
...options,
|
...options,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user