diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 00e7c0ff12..79e677b876 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -2524,7 +2524,7 @@ class BaseModelSqlv2 { ? JSON.parse(data[col.title]) : data[col.title]; } catch { - continue + continue; } switch (colOptions.type) { case RelationTypes.BELONGS_TO: @@ -3581,6 +3581,12 @@ class BaseModelSqlv2 { const childTn = this.getTnPath(childTable); const parentTn = this.getTnPath(parentTable); + const prevData = await this.readByPk( + rowId, + false, + {}, + { ignoreView: true, getHiddenColumn: true }, + ); switch (colOptions.type) { case RelationTypes.MANY_TO_MANY: @@ -3658,7 +3664,7 @@ class BaseModelSqlv2 { {}, { ignoreView: true, getHiddenColumn: true }, ); - await this.afterInsert(response, this.dbDriver, cookie); + await this.afterUpdate(prevData, response, this.dbDriver, cookie); await this.afterAddChild(rowId, childId, cookie); }