mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-21 00:06:44 +01:00
fix swr fetcher
This commit is contained in:
parent
0e9c8a4ddd
commit
da36f25fd0
@ -10,13 +10,7 @@ export function ApiProvider({ children, options }) {
|
|||||||
return (
|
return (
|
||||||
<SWRConfig
|
<SWRConfig
|
||||||
value={{
|
value={{
|
||||||
fetcher: (arg) => {
|
fetcher: (path, params) => axios.get(path, { params }).then((res) => res.data),
|
||||||
if (typeof arg === 'string') {
|
|
||||||
return axios.get(arg).then((res) => res.data);
|
|
||||||
}
|
|
||||||
const [path, params] = arg;
|
|
||||||
return axios.get(path, { params }).then((res) => res.data);
|
|
||||||
},
|
|
||||||
...options,
|
...options,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user