(type: string, account: string, container: string, enabled = true)
| 29 | }; |
| 30 | |
| 31 | export const useQueryDataSourceMetaPaths = (type: string, account: string, container: string, enabled = true) => { |
| 32 | const { dataSourcesQuery, filesQuery } = useUserSettings(); |
| 33 | const { instance } = useMsal(); |
| 34 | if (!dataSourcesQuery.data || !filesQuery.data) { |
| 35 | return useQuery(['invalidQuery'], () => null); |
| 36 | } |
| 37 | const metadataClient = MetadataClientFactory(type, filesQuery.data, dataSourcesQuery.data, instance); |
| 38 | return useQuery( |
| 39 | ['datasource', type, account, container, 'meta', 'paths'], |
| 40 | () => { |
| 41 | |
| 42 | return metadataClient.getDataSourceMetaPaths(account, container); |
| 43 | }, |
| 44 | { |
| 45 | enabled: enabled && !!dataSourcesQuery.data && !!filesQuery.data, |
| 46 | staleTime: Infinity, |
| 47 | } |
| 48 | ); |
| 49 | }; |
| 50 | |
| 51 | export const useQueryTrack = (type: string, account: string, container: string, filepath: string, enabled = true) => { |
| 52 | const { dataSourcesQuery, filesQuery } = useUserSettings(); |
no test coverage detected