Skip to content

Commit

Permalink
one where all queries shall be case sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
2yk committed Jul 23, 2019
1 parent 96ec754 commit 74e1e40
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.4.3

* All queries shall be case sensitive

# 1.4.2

* Fix the issue where reference ids are not working with filters
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "easy-express-crud-generator",
"version": "1.4.2",
"version": "1.4.3",
"description": "Rest apis generator for node, express app",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/helper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ module.exports.getQueryObj = (queryObj = {}) => {

// filters
allFilterSuffix.forEach((y) => {
if (x.toLowerCase().includes(y)) {
const field = x.toLowerCase().replace(`_${y}`, '');
if (x.includes(y)) {
const field = x.replace(`_${y}`, '');
switch (y) {
case (CONTAINS):
obj.query[field] = { $regex: new RegExp(queryObj[x], 'i') };
Expand Down

0 comments on commit 74e1e40

Please sign in to comment.