Type action store

This commit is contained in:
Adria Navarro 2024-12-27 18:21:16 +01:00
parent 0684b431e4
commit d48b6c20a3
1 changed files with 18 additions and 10 deletions

View File

@ -55,14 +55,22 @@ interface RowActionStore {
value: any value: any
apply: boolean apply: boolean
}) => Promise<void> }) => Promise<void>
applyRowChanges: any applyRowChanges: (params: {
deleteRows: any rowId: string
loadNextPage: any changes?: any
refreshRow: any updateState?: boolean
replaceRow: any handleErrors?: boolean
refreshData: any }) => Promise<UIRow | undefined>
cleanRow: any deleteRows: (rowsToDelete: UIRow[]) => Promise<void>
bulkUpdate: any loadNextPage: () => void
refreshRow: (id: string) => Promise<void>
replaceRow: (id: string, row: UIRow | undefined) => void
refreshData: () => void
cleanRow: (row: UIRow) => Row
bulkUpdate: (
changeMap: Record<string, any>,
progressCallback: (any: number) => void
) => Promise<void>
} }
} }
} }
@ -763,8 +771,8 @@ export const createActions = (context: StoreContext): RowActionStore => {
// Cleans a row by removing any internal grid metadata from it. // Cleans a row by removing any internal grid metadata from it.
// Call this before passing a row to any sort of external flow. // Call this before passing a row to any sort of external flow.
const cleanRow = (row: Row) => { const cleanRow = (row: UIRow) => {
let clone = { ...row } let clone: Row = { ...row }
delete clone.__idx delete clone.__idx
delete clone.__metadata delete clone.__metadata
if (!get(hasBudibaseIdentifiers) && isGeneratedRowID(clone._id!)) { if (!get(hasBudibaseIdentifiers) && isGeneratedRowID(clone._id!)) {