From 690a442e61106ad250cd7838772ec6072f229722 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 7 Jan 2025 13:08:17 +0100 Subject: [PATCH] convert QueryArrayFetch --- .../fetch/{QueryArrayFetch.js => QueryArrayFetch.ts} | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) rename packages/frontend-core/src/fetch/{QueryArrayFetch.js => QueryArrayFetch.ts} (68%) diff --git a/packages/frontend-core/src/fetch/QueryArrayFetch.js b/packages/frontend-core/src/fetch/QueryArrayFetch.ts similarity index 68% rename from packages/frontend-core/src/fetch/QueryArrayFetch.js rename to packages/frontend-core/src/fetch/QueryArrayFetch.ts index 222697b78f..15f86ae7fc 100644 --- a/packages/frontend-core/src/fetch/QueryArrayFetch.js +++ b/packages/frontend-core/src/fetch/QueryArrayFetch.ts @@ -1,11 +1,11 @@ -import FieldFetch from "./FieldFetch" +import FieldFetch, { FieldDatasource } from "./FieldFetch" import { getJSONArrayDatasourceSchema, generateQueryArraySchemas, } from "../utils/json" export default class QueryArrayFetch extends FieldFetch { - async getDefinition(datasource) { + async getDefinition(datasource: FieldDatasource) { if (!datasource?.tableId) { return null } @@ -17,7 +17,11 @@ export default class QueryArrayFetch extends FieldFetch { table?.schema, table?.nestedSchemaFields ) - return { schema: getJSONArrayDatasourceSchema(schema, datasource) } + const result: { + schema: Record | null + } = { schema: getJSONArrayDatasourceSchema(schema, datasource) } + + return result } catch (error) { return null }