Proper type QueryArrayFetch
This commit is contained in:
parent
0112087af1
commit
af0312e5fe
|
@ -14,12 +14,12 @@ export default class QueryArrayFetch extends FieldFetch {
|
|||
try {
|
||||
const table = await this.API.fetchQueryDefinition(datasource.tableId)
|
||||
const schema = generateQueryArraySchemas(
|
||||
table?.schema,
|
||||
table?.nestedSchemaFields
|
||||
table.schema,
|
||||
table.nestedSchemaFields
|
||||
)
|
||||
const result: {
|
||||
schema: Record<string, any> | null
|
||||
} = { schema: getJSONArrayDatasourceSchema(schema, datasource) }
|
||||
const result = {
|
||||
schema: getJSONArrayDatasourceSchema(schema, datasource),
|
||||
}
|
||||
|
||||
return result
|
||||
} catch (error) {
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import { QuerySchema } from "@budibase/types"
|
||||
|
||||
type Schema = Record<string, QuerySchema | string>
|
||||
|
||||
export const getJSONArrayDatasourceSchema: (
|
||||
tableSchema: Schema,
|
||||
datasource: any
|
||||
) => Record<string, { type: string; name: string; prefixKeys: string }>
|
||||
|
||||
export const generateQueryArraySchemas: (
|
||||
schema: Schema,
|
||||
nestedSchemaFields?: Record<string, Schema>
|
||||
) => Schema
|
Loading…
Reference in New Issue