Merge branch 'master' into s3-upload-fixes
This commit is contained in:
commit
493fe0589c
|
@ -31,7 +31,7 @@ const getDatasourceFetchInstance = datasource => {
|
|||
if (!handler) {
|
||||
return null
|
||||
}
|
||||
return new handler({ API })
|
||||
return new handler({ API, datasource })
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -52,7 +52,7 @@ export const fetchDatasourceSchema = async (
|
|||
// Get the normal schema as long as we aren't wanting a form schema
|
||||
let schema
|
||||
if (datasource?.type !== "query" || !options?.formSchema) {
|
||||
schema = instance.getSchema(datasource, definition)
|
||||
schema = instance.getSchema(definition)
|
||||
} else if (definition.parameters?.length) {
|
||||
schema = {}
|
||||
definition.parameters.forEach(param => {
|
||||
|
|
|
@ -179,9 +179,6 @@ export default abstract class DataFetch<
|
|||
this.store.update($store => ({ ...$store, loaded: true }))
|
||||
return
|
||||
}
|
||||
|
||||
// Initially fetch data but don't bother waiting for the result
|
||||
this.getInitialData()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -33,7 +33,12 @@ const DataFetchMap = {
|
|||
export const fetchData = ({ API, datasource, options }: any) => {
|
||||
const Fetch =
|
||||
DataFetchMap[datasource?.type as keyof typeof DataFetchMap] || TableFetch
|
||||
return new Fetch({ API, datasource, ...options })
|
||||
const fetch = new Fetch({ API, datasource, ...options })
|
||||
|
||||
// Initially fetch data but don't bother waiting for the result
|
||||
fetch.getInitialData()
|
||||
|
||||
return fetch
|
||||
}
|
||||
|
||||
// Creates an empty fetch instance with no datasource configured, so no data
|
||||
|
|
Loading…
Reference in New Issue