Browse Source

feat(server): Trim string arg to filter "contains" list queries

Michael Bromley 7 years ago
parent
commit
b1c983fb38

+ 1 - 1
server/src/service/helpers/list-query-builder/parse-filter-params.ts

@@ -75,7 +75,7 @@ function buildWhereCondition(fieldName: string, operator: Operator, operand: any
         case 'contains':
             return {
                 clause: `${fieldName} LIKE :arg1`,
-                parameters: { arg1: `%${operand}%` },
+                parameters: { arg1: `%${operand.trim()}%` },
             };
         case 'lt':
         case 'before':