Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: virtual column add

mertmit96128a3e8a5d
diff --git a/packages/nocodb/src/services/columns.service.ts b/packages/nocodb/src/services/columns.service.ts
index 136cbae0db..7831a94d5b 100644
--- a/packages/nocodb/src/services/columns.service.ts
+++ b/packages/nocodb/src/services/columns.service.ts
@@ -1872,7 +1872,10 @@ export class ColumnsService implements IColumnsService {
event: EventType.META_EVENT,
payload: {
action: 'column_update',
- payload: table,
+ payload: {
+ table,
+ column: updatedColumn,
+ },
},
},
context.socket_id,
@@ -2611,9 +2614,7 @@ export class ColumnsService implements IColumnsService {
await table.getColumns(context);
- const columnId = table.columns.find(
- (c) => c.title === param.column.title,
- )?.id;
+ const newColumn = table.columns.find((c) => c.title === param.column.title);
if (!isLinksOrLTAR(param.column)) {
this.appHooksService.emit(AppEvents.COLUMN_CREATE, {
@@ -2621,9 +2622,9 @@ export class ColumnsService implements IColumnsService {
column: {
...param.column,
fk_model_id: table.id,
- id: columnId,
+ id: newColumn?.id,
},
- columnId,
+ columnId: newColumn?.id,
req: param.req,
context,
columns: table.columns,
@@ -2636,7 +2637,10 @@ export class ColumnsService implements IColumnsService {
event: EventType.META_EVENT,
payload: {
action: 'column_add',
- payload: table,
+ payload: {
+ table,
+ column: newColumn,
+ },
},
},
context.socket_id,
@@ -3219,7 +3223,10 @@ export class ColumnsService implements IColumnsService {
event: EventType.META_EVENT,
payload: {
action: 'column_delete',
- payload: table,
+ payload: {
+ table,
+ column,
+ },
},
},
context.socket_id,