@onehat/data 1.22.13 → 1.22.15
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 +1 -1
- package/src/Property/Currency.js +1 -1
- package/src/Repository/Ajax.js +33 -2
package/package.json
CHANGED
package/src/Property/Currency.js
CHANGED
package/src/Repository/Ajax.js
CHANGED
|
@@ -316,7 +316,23 @@ class AjaxRepository extends Repository {
|
|
|
316
316
|
if (!this.hasBaseParam(name)) {
|
|
317
317
|
return null;
|
|
318
318
|
}
|
|
319
|
-
|
|
319
|
+
|
|
320
|
+
// Handle simple property access
|
|
321
|
+
if (this._baseParams.hasOwnProperty(name)) {
|
|
322
|
+
return this._baseParams[name];
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Handle array notation like "conditions[fleets__enterprise_id]"
|
|
326
|
+
const keys = name.split(/[\[\].]+/).filter(Boolean);
|
|
327
|
+
let current = this._baseParams;
|
|
328
|
+
|
|
329
|
+
for(const key of keys) {
|
|
330
|
+
if (!current || !current.hasOwnProperty(key)) {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
current = current[key];
|
|
334
|
+
}
|
|
335
|
+
return current;
|
|
320
336
|
}
|
|
321
337
|
|
|
322
338
|
/**
|
|
@@ -332,7 +348,22 @@ class AjaxRepository extends Repository {
|
|
|
332
348
|
* @param {string} name - Param name
|
|
333
349
|
*/
|
|
334
350
|
hasParam(name) {
|
|
335
|
-
|
|
351
|
+
if (this._params.hasOwnProperty(name)) {
|
|
352
|
+
return true;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// Check for array notation
|
|
356
|
+
const keys = name.split(/[\[\].]+/).filter(Boolean);
|
|
357
|
+
let current = this._params,
|
|
358
|
+
key;
|
|
359
|
+
|
|
360
|
+
for(key of keys) {
|
|
361
|
+
if (!current || !current.hasOwnProperty(key)) {
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
current = current[key];
|
|
365
|
+
}
|
|
366
|
+
return true;
|
|
336
367
|
}
|
|
337
368
|
|
|
338
369
|
/**
|