Browse Source

fix: avoid extra single quote added by knex binding

pull/2204/head
Wing-Kam Wong 3 years ago
parent
commit
c81aa5f323
  1. 4
      packages/nocodb/src/lib/dataMapper/lib/sql/conditionV2.ts

4
packages/nocodb/src/lib/dataMapper/lib/sql/conditionV2.ts

@ -221,7 +221,7 @@ const parseConditionV2 = async (
case 'like':
if (column.uidt === UITypes.Formula) {
[field, val] = [val, field];
val = `%${val}%`.replace("%'", '%').replace("'%", '%');
val = `%${val}%`.replace(/^%'([\s\S]*)'%$/, '%$1%')
} else {
val = `%${val}%`;
}
@ -234,7 +234,7 @@ const parseConditionV2 = async (
case 'nlike':
if (column.uidt === UITypes.Formula) {
[field, val] = [val, field];
val = `%${val}%`.replace("%'", '%').replace("'%", '%');
val = `%${val}%`.replace(/^%'([\s\S]*)'%$/, '%$1%')
} else {
val = `%${val}%`;
}

Loading…
Cancel
Save