@onehat/data 1.4.3 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -4,6 +4,21 @@ import AjaxRepository from './Ajax';
4
4
  import qs from 'qs';
5
5
  import _ from 'lodash';
6
6
 
7
+ const nonConditionFilters = [
8
+ 'q',
9
+ 'hydrate',
10
+ 'fields',
11
+ 'distinct',
12
+ 'leftJoinWith',
13
+ 'join',
14
+ 'where',
15
+ 'matching',
16
+ 'contain',
17
+ 'order',
18
+ 'limit',
19
+ 'page',
20
+ ];
21
+
7
22
  /**
8
23
  * This class contains overrides of specific functions in
9
24
  * AjaxRepository that are unique to OneBuild.
@@ -129,12 +144,16 @@ class OneBuildRepository extends AjaxRepository {
129
144
  // Clear existing "conditions" params
130
145
  if (!_.isEmpty(this._params)) {
131
146
  this._params = _.omitBy(this._params, (value, key) => {
132
- return key.match(/^conditions/);
147
+ return key.match(/^conditions/) || _.includes(nonConditionFilters, key);
133
148
  });
134
149
  }
135
150
 
136
151
  _.each(this.filters, (filter, ix) => {
137
- this.setParam('conditions[' + filter.name + ']', filter.value);
152
+ if (_.includes(nonConditionFilters, filter.name)) {
153
+ this.setParam(filter.name, filter.value);
154
+ } else {
155
+ this.setParam('conditions[' + filter.name + ']', filter.value);
156
+ }
138
157
  });
139
158
 
140
159
  if (this.isLoaded) {