Browse Source

fix: avoid extra single quote added by knex binding

feat/0523-export-schema
Wing-Kam Wong 3 years ago committed by Raju Udava
parent
commit
ad4991c943
  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