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