mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Postgres Node): Fix inserting null or undefined in type=json columns (#14672)
This commit is contained in:
@@ -414,7 +414,10 @@ export function convertValuesToJsonWithPgp(
|
||||
values: IDataObject,
|
||||
) {
|
||||
schema
|
||||
.filter(({ data_type }: { data_type: string }) => data_type === 'json')
|
||||
.filter(
|
||||
({ data_type, column_name }) =>
|
||||
data_type === 'json' && values[column_name] !== null && values[column_name] !== undefined,
|
||||
)
|
||||
.forEach(({ column_name }) => {
|
||||
values[column_name] = pgp.as.json(values[column_name], true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user