elderwand 0.1.50 → 0.1.52

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;
@@ -126,6 +127,10 @@ module.exports.inherit = function (child) {
126
127
 
127
128
 
128
129
  var criteria = {}
130
+ if(child.model.generateFilter){
131
+ criteria.inject(child.model.generateCriteria(req.anyKey))
132
+ }
133
+
129
134
  if(child.model.listByUserOptions){
130
135
  criteria = child.model.listByUserOptions(options, req.user, callback)
131
136
  }else{
@@ -563,6 +568,10 @@ module.exports.inherit = function (child) {
563
568
  fs.mkdirSync(path.resolve('uploads/' + child.singularName + "/" + req[child.singularName].id));
564
569
  }
565
570
  var needToSave = false
571
+
572
+ if(req.files == null){
573
+ req.files = {}
574
+ }
566
575
  async.each(Object.keys(req.files), function(key, next){
567
576
  if(req[child.singularName].walk(key) == undefined || req[child.singularName].walk(key) == null){
568
577
  req[child.singularName].walk(key, [])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elderwand",
3
- "version": "0.1.50",
3
+ "version": "0.1.52",
4
4
  "description": "KLE Technologies Internal Framework",
5
5
  "main": "./node_modules/.bin/nodemon index.js",
6
6
  "scripts": {