Type UIRow

This commit is contained in:
Adria Navarro 2024-12-27 10:26:09 +01:00
parent 51688543b1
commit 8958b8d14c
4 changed files with 11 additions and 7 deletions

View File

@ -3,12 +3,12 @@ import { getDatasourceDefinition, getDatasourceSchema } from "../../../fetch"
import { enrichSchemaWithRelColumns, memo } from "../../../utils"
import { cloneDeep } from "lodash"
import {
Row,
SaveRowRequest,
SaveTableRequest,
UIDatasource,
UIFieldMutation,
UIFieldSchema,
UIRow,
UpdateViewRequest,
ViewV2Type,
} from "@budibase/types"
@ -331,7 +331,7 @@ export const createActions = (context: StoreContext): ActionDatasourceStore => {
}
// Deletes rows from the datasource
const deleteRows = async (rows: Row[]) => {
const deleteRows = async (rows: UIRow[]) => {
return await getAPI()?.actions.deleteRows(rows)
}

View File

@ -1,8 +1,8 @@
import {
Row,
SaveRowRequest,
SaveTableRequest,
UIDatasource,
UIRow,
UpdateViewRequest,
} from "@budibase/types"
@ -10,10 +10,10 @@ interface DatasourceBaseActions<
TSaveDefinitionRequest = UpdateViewRequest | SaveTableRequest
> {
saveDefinition: (newDefinition: TSaveDefinitionRequest) => Promise<void>
addRow: (row: SaveRowRequest) => Promise<Row | void>
updateRow: (row: SaveRowRequest) => Promise<Row | void>
deleteRows: (rows: Row[]) => Promise<void>
getRow: (id: string) => Promise<Row | void>
addRow: (row: SaveRowRequest) => Promise<UIRow | void>
updateRow: (row: SaveRowRequest) => Promise<UIRow | void>
deleteRows: (rows: UIRow[]) => Promise<void>
getRow: (id: string) => Promise<UIRow | void>
isDatasourceValid: (datasource: UIDatasource) => boolean | void
canUseColumn: (name: string) => boolean | void
}

View File

@ -4,3 +4,4 @@ export * from "./table"
export * from "./view"
export * from "./user"
export * from "./filters"
export * from "./rows"

View File

@ -0,0 +1,3 @@
import { Row } from "@budibase/types"
export type UIRow = Row & { _id: string }