This commit is contained in:
Adria Navarro 2025-01-08 12:57:25 +01:00
parent f053438a64
commit 5d63fe251f
3 changed files with 5 additions and 5 deletions

View File

@ -360,12 +360,11 @@ export default abstract class DataFetch<
/** /**
* Gets the schema definition for a datasource. * Gets the schema definition for a datasource.
* @param datasource the datasource
* @param definition the datasource definition * @param definition the datasource definition
* @return {object} the schema * @return {object} the schema
*/ */
getSchema(_datasource: TDatasource | null, definition: TDefinition | null) { getSchema(definition: TDefinition | null): Record<string, any> | undefined {
return definition?.schema return definition?.schema ?? undefined
} }
/** /**

View File

@ -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 return definition?.views?.[datasource.name]?.schema
} }

View File

@ -76,5 +76,5 @@ export const getDatasourceSchema = ({
definition?: { schema?: TableSchema } definition?: { schema?: TableSchema }
}) => { }) => {
const instance = createEmptyFetchInstance({ API, datasource }) const instance = createEmptyFetchInstance({ API, datasource })
return instance?.getSchema(datasource, definition) return instance?.getSchema(definition)
} }