Skip to content

Commit 027a0c7

Browse files
fix: add label fallback to name in toast messages for objects/fields
Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/6743512a-a655-40f0-943f-f85d685910a5 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent a6bf307 commit 027a0c7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

apps/console/src/pages/system/ObjectManagerPage.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ function ObjectDetailView({ object, metadataObject, onBack, metadataService, onR
170170

171171
const diff = MetadataService.diffFields(previous, updated);
172172
const actionLabel = diff
173-
? diff.type === 'create' ? `Field "${diff.field.label}" created`
174-
: diff.type === 'update' ? `Field "${diff.field.label}" updated`
175-
: `Field "${diff.field.label}" deleted`
173+
? diff.type === 'create' ? `Field "${diff.field.label || diff.field.name}" created`
174+
: diff.type === 'update' ? `Field "${diff.field.label || diff.field.name}" updated`
175+
: `Field "${diff.field.label || diff.field.name}" deleted`
176176
: 'Field configuration updated';
177177

178178
setSaving(true);
@@ -379,9 +379,9 @@ export function ObjectManagerPage() {
379379
await refresh();
380380

381381
const actionLabel = diff
382-
? diff.type === 'create' ? `Object "${diff.object.label}" created`
383-
: diff.type === 'update' ? `Object "${diff.object.label}" updated`
384-
: `Object "${diff.object.label}" deleted`
382+
? diff.type === 'create' ? `Object "${diff.object.label || diff.object.name}" created`
383+
: diff.type === 'update' ? `Object "${diff.object.label || diff.object.name}" updated`
384+
: `Object "${diff.object.label || diff.object.name}" deleted`
385385
: 'Object definitions updated';
386386
toast.success(actionLabel);
387387
} catch (err: any) {

0 commit comments

Comments
 (0)