elderwand 0.1.53 → 0.1.55
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;
|
|
@@ -121,7 +121,7 @@ module.exports.inherit = function (child) {
|
|
|
121
121
|
var options = {
|
|
122
122
|
perPage: perPage,
|
|
123
123
|
page: page,
|
|
124
|
-
search: text
|
|
124
|
+
search: text,
|
|
125
125
|
criteria:{}
|
|
126
126
|
};
|
|
127
127
|
options.inject(req.options)
|
|
@@ -131,9 +131,9 @@ module.exports.inherit = function (child) {
|
|
|
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
|
|