elderwand 0.1.54 → 0.1.56

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.
@@ -71,7 +71,7 @@ module.exports.inherit = function (child) {
71
71
  res.statusData = "Error"
72
72
  return res.render('500', {});
73
73
  }
74
- child.model.count(criteria || {}).exec(function (err, count) {
74
+ child.model.count(options.criteria || {}).exec(function (err, count) {
75
75
  var pageCount = Math.ceil(count / perPage);
76
76
  var pages = [];
77
77
  var start = pageCount > 10 && page - 5 > 0 ? page - 5 : 0;
@@ -126,14 +126,14 @@ module.exports.inherit = function (child) {
126
126
  };
127
127
  options.inject(req.options)
128
128
 
129
- if(child.model.generateFilter){
129
+ if(child.model.generateCriteria){
130
130
  options.criteria.inject(child.model.generateCriteria(req.anyKey))
131
131
  }
132
132
 
133
133
  if(child.model.listByUserOptions){
134
- criteria = child.model.listByUserOptions(options, req.user, callback)
134
+ options.criteria = child.model.listByUserOptions(options, req.user, callback)
135
135
  }else{
136
- criteria = child.model.list(options, callback);
136
+ options.criteria = child.model.list(options, callback);
137
137
  }
138
138
  };
139
139
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elderwand",
3
- "version": "0.1.54",
3
+ "version": "0.1.56",
4
4
  "description": "KLE Technologies Internal Framework",
5
5
  "main": "./node_modules/.bin/nodemon index.js",
6
6
  "scripts": {