Class

Filter

(private) Filter(filters, resource)

Filter object wrapping up selected filters.

Constructor

# private new Filter(filters, resource)

Parameters:
Name Type Description
filters Object.<String, (Object|String)>

selected filters

resource BaseResource

resource which is filtered

View Source adminjs/src/backend/utils/filter/filter.ts, line 8

Classes

Filter
Filter

Methods

# static normalizeKeys(filters) → {Object}

Changes raw nested filters to form Object.
Parameters:
Name Type Description
filters Object

View Source adminjs/src/backend/utils/filter/filter.ts, line 111

Object
Example
const filters = {
 nested: {field: 'ala'},
 'dataField~~from': '2019-08-14'
}

const normalized = Filter.normalizeFilters(filters)
// {
//   'nested.filter': 'ala',
//   'dataField': {from: '2019-08-14'}
// }

# get(key) → {Filter.Property|undefined}

Returns filter for a given property key
Parameters:
Name Type Description
key String

property key

View Source adminjs/src/backend/utils/filter/filter.ts, line 126

Filter.Property | undefined

# async populate() → {Promise.<Filter>}

Populates all filtered properties which refers to other resources

View Source adminjs/src/backend/utils/filter/filter.ts, line 133

Promise.<Filter>