convert QueryArrayFetch
This commit is contained in:
parent
364e997fc2
commit
690a442e61
|
@ -1,11 +1,11 @@
|
||||||
import FieldFetch from "./FieldFetch"
|
import FieldFetch, { FieldDatasource } from "./FieldFetch"
|
||||||
import {
|
import {
|
||||||
getJSONArrayDatasourceSchema,
|
getJSONArrayDatasourceSchema,
|
||||||
generateQueryArraySchemas,
|
generateQueryArraySchemas,
|
||||||
} from "../utils/json"
|
} from "../utils/json"
|
||||||
|
|
||||||
export default class QueryArrayFetch extends FieldFetch {
|
export default class QueryArrayFetch extends FieldFetch {
|
||||||
async getDefinition(datasource) {
|
async getDefinition(datasource: FieldDatasource) {
|
||||||
if (!datasource?.tableId) {
|
if (!datasource?.tableId) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,11 @@ export default class QueryArrayFetch extends FieldFetch {
|
||||||
table?.schema,
|
table?.schema,
|
||||||
table?.nestedSchemaFields
|
table?.nestedSchemaFields
|
||||||
)
|
)
|
||||||
return { schema: getJSONArrayDatasourceSchema(schema, datasource) }
|
const result: {
|
||||||
|
schema: Record<string, any> | null
|
||||||
|
} = { schema: getJSONArrayDatasourceSchema(schema, datasource) }
|
||||||
|
|
||||||
|
return result
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
Loading…
Reference in New Issue