add callback args for listByPrincipalType to jsdoc comment, pass explicit arguments to callback

This commit is contained in:
Esco Obong 2015-03-26 10:10:13 -04:00
parent 1993338c0b
commit 957f84e989
1 changed files with 4 additions and 2 deletions

View File

@ -72,7 +72,7 @@ module.exports = function(Role) {
* @param {*} model model type to fetch
* @param {String} [principalType] principalType used in the rolemapping for model
* @param {object} [query] query object passed to model find call
* @param {Function} [callback]
* @param {Function} [callback] callback function called with `(err, models)` arguments.
*/
function listByPrincipalType(model, principalType, query, callback) {
if (callback === undefined) {
@ -92,7 +92,9 @@ module.exports = function(Role) {
});
query.where = query.where || {};
query.where.id = {inq: ids};
model.find(query, callback);
model.find(query, function(err, models) {
callback(err, models);
});
});
}