Skip to content

Commit 84c80d8

Browse files
committed
Merge pull request #61 from ltullman/master
Add modelFilter hook
2 parents 8c1c428 + 285a903 commit 84c80d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/data_form.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ DataForm.prototype.models = function () {
359359

360360
return function (req, res) {
361361
// TODO: Make this less wasteful - we only need to send the resourceNames of the resources
362-
res.send(that.resources);
362+
// Check for optional modelFilter and call it with the request and current list. Otherwise just return the list.
363+
res.send(that.options.modelFilter ? that.options.modelFilter.call(null, req, that.resources) : that.resources);
364+
363365
};
364366
};
365367

0 commit comments

Comments
 (0)