revamp recordings

This commit is contained in:
Blake Blackshear
2022-05-10 07:48:29 -05:00
parent 78e1782084
commit 691ed6a4c7
5 changed files with 286 additions and 219 deletions

View File

@@ -10,7 +10,13 @@ export function ApiProvider({ children, options }) {
return (
<SWRConfig
value={{
fetcher: (path) => axios.get(path).then((res) => res.data),
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);
},
...options,
}}
>