mirror of
https://github.com/Jellify-Music/App.git
synced 2026-05-12 22:38:38 -05:00
clean this up
This commit is contained in:
+9
-1
@@ -4,7 +4,15 @@ import { createApi } from "./queries/functions/api";
|
||||
|
||||
export const useApi = (serverUrl?: string, username?: string, password?: string, accessToken?: string) => useQuery({
|
||||
queryKey: [QueryKeys.Api, serverUrl, username, password, accessToken],
|
||||
queryFn: () => createApi(serverUrl, username, password, accessToken),
|
||||
queryFn: ({ queryKey }) => {
|
||||
|
||||
const serverUrl : string | undefined = queryKey[1];
|
||||
const username : string | undefined = queryKey[2];
|
||||
const password : string | undefined = queryKey[3];
|
||||
const accessToken : string | undefined = queryKey[4];
|
||||
|
||||
return createApi(serverUrl, username, password, accessToken)
|
||||
},
|
||||
gcTime: 1000,
|
||||
refetchInterval: false
|
||||
})
|
||||
Reference in New Issue
Block a user