Postgres: Properly handle undefined field values (#4186)
Prevents `UnhandledPromiseRejectionWarning: Unhandled promise rejection` when building queries.
This commit is contained in:
committed by
Florent Vilmart
parent
cf630ba462
commit
9371958a09
@@ -235,7 +235,7 @@ const buildWhereClause = ({ schema, query, index }) => {
|
||||
patterns.push(`${name} = '${fieldValue}'`);
|
||||
}
|
||||
}
|
||||
} else if (fieldValue === null) {
|
||||
} else if (fieldValue === null || fieldValue === undefined) {
|
||||
patterns.push(`$${index}:name IS NULL`);
|
||||
values.push(fieldName);
|
||||
index += 1;
|
||||
|
||||
Reference in New Issue
Block a user