diff --git a/package.json b/package.json index ff1a86a..c2658d6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jest", "description": "JavaScriptational State Transfer. JS restful API layer with Mongoose based resources. Inspired by python Tastypie", - "version": "0.1.37", + "version": "0.1.38", "author": "Ishai Jaffe ", "contributors": [ { diff --git a/resource.js b/resource.js index be580c3..69e5c4b 100644 --- a/resource.js +++ b/resource.js @@ -703,7 +703,7 @@ var Resource = module.exports = Class.extend({ delete filters[field]; } if(operand == 'endswith') { - filters[field.replace('__endswith','')] = new RegExp(this.escape_regex(filters[field] + '$')); + filters[field.replace('__endswith','')] = new RegExp(this.escape_regex(filters[field]) + '$'); delete filters[field]; } if(operand == 'iexact') { @@ -719,7 +719,7 @@ var Resource = module.exports = Class.extend({ delete filters[field]; } if(operand == 'iendswith') { - filters[field.replace('__iendswith','')] = new RegExp(this.escape_regex(filters[field] + '$'),'i'); + filters[field.replace('__iendswith','')] = new RegExp(this.escape_regex(filters[field]) + '$','i'); delete filters[field]; } if (field == 'or')