(auth?: MobileAuth)
| 49 | }; |
| 50 | |
| 51 | const useConfig = (auth?: MobileAuth) => { |
| 52 | return useQuery({ |
| 53 | queryKey: ["config", auth?.instance ?? "web"], |
| 54 | queryFn: async () => { |
| 55 | const response = await fetch( |
| 56 | (auth?.instance ? auth.instance : "") + "/api/v1/config", |
| 57 | auth?.session |
| 58 | ? { |
| 59 | headers: { |
| 60 | Authorization: `Bearer ${auth.session}`, |
| 61 | }, |
| 62 | } |
| 63 | : undefined |
| 64 | ); |
| 65 | const data = await response.json(); |
| 66 | |
| 67 | return data.response as Config; |
| 68 | }, |
| 69 | }); |
| 70 | }; |
| 71 | |
| 72 | export { useConfig, compareInstanceVersions, isAtLeastInstanceVersion }; |
no outgoing calls
no test coverage detected