Browse Source

fix: convert object/array to json string before insert

pull/8664/head
Pranav C 6 months ago
parent
commit
b3d4b428a8
  1. 8
      packages/nocodb/src/db/BaseModelSqlv2.ts

8
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -6715,6 +6715,7 @@ class BaseModelSqlv2 {
if ( if (
![ ![
UITypes.Attachment, UITypes.Attachment,
UITypes.JSON,
UITypes.User, UITypes.User,
UITypes.CreatedTime, UITypes.CreatedTime,
UITypes.LastModifiedTime, UITypes.LastModifiedTime,
@ -6889,6 +6890,13 @@ class BaseModelSqlv2 {
} }
} }
} }
} else if (UITypes.JSON === column.uidt) {
if (
data[column.column_name] &&
typeof data[column.column_name] !== 'string'
) {
data[column.column_name] = JSON.stringify(data[column.column_name]);
}
} }
} }
} }

Loading…
Cancel
Save