Proper type nestedProvider

This commit is contained in:
Adria Navarro 2025-01-08 13:54:37 +01:00
parent fc4336a9f3
commit 88760d473e
1 changed files with 18 additions and 2 deletions

View File

@ -1,7 +1,23 @@
import { Row, TableSchema } from "@budibase/types"
import DataFetch from "./DataFetch"
export default class NestedProviderFetch extends DataFetch<any, any> {
async getDefinition(datasource: any) {
interface NestedProviderDatasource {
value?: {
schema: TableSchema
primaryDisplay: string
rows: Row[]
}
}
interface NestedProviderDefinition {
schema?: TableSchema
primaryDisplay?: string
}
export default class NestedProviderFetch extends DataFetch<
NestedProviderDatasource,
NestedProviderDefinition
> {
async getDefinition(datasource: NestedProviderDatasource) {
// Nested providers should already have exposed their own schema
return {
schema: datasource?.value?.schema,