Simplify
This commit is contained in:
parent
f053438a64
commit
5d63fe251f
|
@ -360,12 +360,11 @@ export default abstract class DataFetch<
|
|||
|
||||
/**
|
||||
* Gets the schema definition for a datasource.
|
||||
* @param datasource the datasource
|
||||
* @param definition the datasource definition
|
||||
* @return {object} the schema
|
||||
*/
|
||||
getSchema(_datasource: TDatasource | null, definition: TDefinition | null) {
|
||||
return definition?.schema
|
||||
getSchema(definition: TDefinition | null): Record<string, any> | undefined {
|
||||
return definition?.schema ?? undefined
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,7 +19,8 @@ export default class ViewFetch extends DataFetch<ViewV1, Table> {
|
|||
}
|
||||
}
|
||||
|
||||
getSchema(datasource: ViewV1, definition: Table) {
|
||||
getSchema(definition: Table) {
|
||||
const { datasource } = this.options
|
||||
return definition?.views?.[datasource.name]?.schema
|
||||
}
|
||||
|
||||
|
|
|
@ -76,5 +76,5 @@ export const getDatasourceSchema = ({
|
|||
definition?: { schema?: TableSchema }
|
||||
}) => {
|
||||
const instance = createEmptyFetchInstance({ API, datasource })
|
||||
return instance?.getSchema(datasource, definition)
|
||||
return instance?.getSchema(definition)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue