diff --git a/packages/frontend-core/src/api/tables.ts b/packages/frontend-core/src/api/tables.ts index c37c966f95..ebbd7c09bf 100644 --- a/packages/frontend-core/src/api/tables.ts +++ b/packages/frontend-core/src/api/tables.ts @@ -4,24 +4,26 @@ import { CsvToJsonRequest, CsvToJsonResponse, FetchTablesResponse, - MigrateRequest, - MigrateResponse, Row, SaveTableRequest, SaveTableResponse, SearchRowRequest, PaginatedSearchRowResponse, - TableResponse, TableSchema, ValidateNewTableImportRequest, ValidateTableImportRequest, ValidateTableImportResponse, + FindTableResponse, + FetchRowsResponse, + MigrateTableResponse, + MigrateTableRequest, + DeleteTableResponse, } from "@budibase/types" import { BaseAPIClient } from "./types" export interface TableEndpoints { - fetchTableDefinition: (tableId: string) => Promise - fetchTableData: (tableId: string) => Promise + fetchTableDefinition: (tableId: string) => Promise + fetchTableData: (tableId: string) => Promise searchTable: ( sourceId: string, opts: SearchRowRequest @@ -33,9 +35,9 @@ export interface TableEndpoints { ) => Promise csvToJson: (csvString: string) => Promise getTables: () => Promise - getTable: (tableId: string) => Promise + getTable: (tableId: string) => Promise saveTable: (table: SaveTableRequest) => Promise - deleteTable: (id: string, rev: string) => Promise<{ message: string }> + deleteTable: (id: string, rev: string) => Promise validateNewTableImport: ( rows: Row[], schema: TableSchema @@ -48,7 +50,7 @@ export interface TableEndpoints { tableId: string, oldColumn: string, newColumn: string - ) => Promise + ) => Promise } export const buildTableEndpoints = (API: BaseAPIClient): TableEndpoints => ({ @@ -179,7 +181,7 @@ export const buildTableEndpoints = (API: BaseAPIClient): TableEndpoints => ({ }) }, migrateColumn: async (tableId, oldColumn, newColumn) => { - return await API.post({ + return await API.post({ url: `/api/tables/${tableId}/migrate`, body: { oldColumn,