Skip to content

Commit 285a903

Browse files
committed
Add modelFilter hook
1 parent 8c1c428 commit 285a903

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)