elderwand 0.1.51 → 0.1.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -93,6 +93,7 @@ module.exports.inherit = function (child) {
93
93
  page: page + 1,
94
94
  pages: pages,
95
95
  perPage: perPage,
96
+ isFiltered: Object.keys(req.anyKey).length > 0 ? true : false,
96
97
  //menu: utils.getUserMenu(req.user),
97
98
  };
98
99
  data[child.pluralName] = models;
@@ -121,11 +122,14 @@ module.exports.inherit = function (child) {
121
122
  perPage: perPage,
122
123
  page: page,
123
124
  search: text
125
+ criteria:{}
124
126
  };
125
127
  options.inject(req.options)
126
128
 
129
+ if(child.model.generateFilter){
130
+ options.criteria.inject(child.model.generateCriteria(req.anyKey))
131
+ }
127
132
 
128
- var criteria = {}
129
133
  if(child.model.listByUserOptions){
130
134
  criteria = child.model.listByUserOptions(options, req.user, callback)
131
135
  }else{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elderwand",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "description": "KLE Technologies Internal Framework",
5
5
  "main": "./node_modules/.bin/nodemon index.js",
6
6
  "scripts": {