From 68eb809d28e58f093f1d20792f2b7d6c569d0a57 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 24 Dec 2024 13:25:34 +0100 Subject: [PATCH] Fix "type" conflicts --- .../src/components/grid/stores/datasource.ts | 8 ++++++-- packages/types/src/ui/stores/grid/table.ts | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/datasource.ts b/packages/frontend-core/src/components/grid/stores/datasource.ts index 62c79e8e78..ce9f2837bb 100644 --- a/packages/frontend-core/src/components/grid/stores/datasource.ts +++ b/packages/frontend-core/src/components/grid/stores/datasource.ts @@ -5,9 +5,11 @@ import { cloneDeep } from "lodash" import { Row, SaveRowRequest, + SaveTableRequest, UIDatasource, UIFieldMutation, UIFieldSchema, + UpdateViewRequest, ViewV2Type, } from "@budibase/types" import { Store as StoreContext } from "." @@ -192,10 +194,12 @@ export const createActions = (context: StoreContext): ActionDatasourceStore => { } // Saves the datasource definition - const saveDefinition = async (newDefinition: UIDatasource) => { + const saveDefinition = async ( + newDefinition: SaveTableRequest | UpdateViewRequest + ) => { // Update local state const originalDefinition = get(definition) - definition.set(newDefinition) + definition.set(newDefinition as UIDatasource) // Update server if (get(config).canSaveSchema) { diff --git a/packages/types/src/ui/stores/grid/table.ts b/packages/types/src/ui/stores/grid/table.ts index 6fae1e908a..a5a13d5fa2 100644 --- a/packages/types/src/ui/stores/grid/table.ts +++ b/packages/types/src/ui/stores/grid/table.ts @@ -4,12 +4,14 @@ import { FieldType, RelationSchemaField, SortOrder, + Table, UISearchFilter, } from "@budibase/types" -export interface UITable { +export interface UITable extends Omit { name: string id: string + type: string tableId: string primaryDisplay?: string sort?: {