From 182de153997b16010c84380631d894f1a11e15d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E7=92=87?= Date: Mon, 16 Dec 2024 23:44:08 +0800 Subject: [PATCH] feat: optimize code --- frontend/src/metadata/hooks/metadata-view.js | 2 +- frontend/src/metadata/views/kanban/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/metadata/hooks/metadata-view.js b/frontend/src/metadata/hooks/metadata-view.js index 8aaf639f569..ddd9e042c4e 100644 --- a/frontend/src/metadata/hooks/metadata-view.js +++ b/frontend/src/metadata/hooks/metadata-view.js @@ -77,7 +77,7 @@ export const MetadataViewProvider = ({ }, [storeRef]); const modifyRecords = (rowIds, idRowUpdates, idOriginalRowUpdates, idOldRowData, idOriginalOldRowData, isCopyPaste = false, { success_callback, fail_callback } = {}) => { - const isRename = storeRef.current.record.checkIsRenameFileOperator(rowIds, idOriginalRowUpdates); + const isRename = storeRef.current.checkIsRenameFileOperator(rowIds, idOriginalRowUpdates); let newName = null; if (isRename) { const rowId = rowIds[0]; diff --git a/frontend/src/metadata/views/kanban/index.js b/frontend/src/metadata/views/kanban/index.js index 02706a9f8c3..093638c2f19 100644 --- a/frontend/src/metadata/views/kanban/index.js +++ b/frontend/src/metadata/views/kanban/index.js @@ -19,7 +19,7 @@ const Kanban = () => { const columns = useMemo(() => metadata.view.columns, [metadata.view.columns]); - const modifyRecord = useCallback((rowId, updates, oldRowData, originalUpdates, originalOldRowData, { success_callback }) => { + const modifyRecord = useCallback((rowId, updates, oldRowData, originalUpdates, originalOldRowData, { success_callback } = {}) => { modifyRecordAPI(rowId, updates, oldRowData, originalUpdates, originalOldRowData, false, { success_callback }); }, [modifyRecordAPI]);