Skip to content

Commit 703647b

Browse files
Copilothotlong
andcommitted
fix: address code review feedback - guard params.recordId, remove unused import
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/91af166c-9201-4e14-830a-485092a258b3
1 parent 3c703f8 commit 703647b

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

apps/console/src/__tests__/ListToolbarActions.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ vi.mock('@object-ui/plugin-list', () => ({
4848
}));
4949

5050
vi.mock('@object-ui/components', async (importOriginal) => {
51-
const React = await import('react');
5251
const actual = await importOriginal<any>();
5352
return {
5453
...actual,

apps/console/src/components/ObjectView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ export function ObjectView({ dataSource, objects, onEdit }: any) {
431431
// Generic list-level API handler: update/execute via dataSource
432432
if (typeof dataSource.execute === 'function') {
433433
await dataSource.execute(objectDef.name, target, params);
434-
} else if (Object.keys(params).length > 0 && typeof dataSource.update === 'function') {
434+
} else if (params.recordId && Object.keys(params).length > 1 && typeof dataSource.update === 'function') {
435435
await dataSource.update(objectDef.name, params.recordId, params);
436436
}
437437

0 commit comments

Comments
 (0)