diff --git a/lib/Field/ReferenceField.js b/lib/Field/ReferenceField.js index 43d3ed9..fb16699 100644 --- a/lib/Field/ReferenceField.js +++ b/lib/Field/ReferenceField.js @@ -54,12 +54,18 @@ class ReferenceField extends Field { * * @param {Object} filters list of filters to apply to the call */ - permanentFilters(filters) { + permanentFilters(arg) { if (!arguments.length) { return this._permanentFilters; } - this._permanentFilters = filters; + if (typeof(arg) == 'function') { + this._getPermanentFilters = (scope) => { + this._permanentFilters = arg(scope); + }; + } else { + this._permanentFilters = arg; + } return this; }