Browse Source

fix: convert number/any other type to string before applying any string method

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/6704/head
Pranav C 1 year ago
parent
commit
cd8b6a1f33
  1. 2
      packages/nocodb/src/db/conditionV2.ts

2
packages/nocodb/src/db/conditionV2.ts

@ -553,7 +553,7 @@ const parseConditionV2 = async (
val = `%${val}%`.replace(/^%'([\s\S]*)'%$/, '%$1%');
} else {
val =
val.startsWith('%') || val.endsWith('%') ? val : `%${val}%`;
(val + '').startsWith('%') || (val + '').endsWith('%') ? val : `%${val}%`;
}
if (qb?.client?.config?.client === 'pg') {
qb = qb.where(knex.raw('??::text ilike ?', [field, val]));

Loading…
Cancel
Save