flamerest 1.0.48 → 1.0.51

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.
Files changed (2) hide show
  1. package/REST.js +15 -7
  2. package/package.json +1 -1
package/REST.js CHANGED
@@ -355,7 +355,7 @@ class FLAMEREST {
355
355
  * @returns {object}
356
356
  */
357
357
  all(table, params) {
358
- return this.get(table, params.where, null, params.fields, params.sort, params.page, params.perPage);
358
+ return this.get(table, params?.where, null, params?.fields, params?.sort, params?.page, params?.perPage, null, null, null, params?.tree);
359
359
  }
360
360
 
361
361
  /**
@@ -393,10 +393,14 @@ class FLAMEREST {
393
393
  // Подготовить значения
394
394
  await this.prepare(values);
395
395
 
396
+ if (appendTo === undefined) appendTo = null;
397
+ if (insertAfter === undefined) insertAfter = null;
398
+ if (insertFirst === undefined) insertFirst = null;
399
+
396
400
  return this.request(this.SERVER + '/api/' + this.version + '/' + table + '/create?'
397
- + (appendTo ? '&appendTo=' + appendTo : '')
398
- + (insertAfter ? '&insertAfter=' + insertAfter : '')
399
- + (insertFirst ? '&insertFirst=' + insertFirst : '')
401
+ + (appendTo !== null ? '&appendTo=' + appendTo : '')
402
+ + (insertAfter !== null ? '&insertAfter=' + insertAfter : '')
403
+ + (insertFirst !== null ? '&insertFirst=' + insertFirst : '')
400
404
  , JSON.stringify(values), 'POST');
401
405
 
402
406
  }
@@ -437,10 +441,14 @@ class FLAMEREST {
437
441
  // Подготовить значения
438
442
  await this.prepare(values);
439
443
 
444
+ if(appendTo === undefined) appendTo = null;
445
+ if (insertAfter === undefined) insertAfter = null;
446
+ if (insertFirst === undefined) insertFirst = null;
447
+
440
448
  return this.request(this.SERVER + '/api/' + this.version + '/' + table + '/update?id=' + ID
441
- + (appendTo ? '&appendTo=' + appendTo : '')
442
- + (insertAfter ? '&insertAfter=' + insertAfter : '')
443
- + (insertFirst ? '&insertFirst=' + insertFirst : '')
449
+ + (appendTo!==null ? '&appendTo=' + appendTo : '')
450
+ + (insertAfter!==null ? '&insertAfter=' + insertAfter : '')
451
+ + (insertFirst!==null ? '&insertFirst=' + insertFirst : '')
444
452
  , JSON.stringify(values), 'PATCH');
445
453
  }
446
454
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flamerest",
3
- "version": "1.0.48",
3
+ "version": "1.0.51",
4
4
  "description": "",
5
5
  "main": "REST.js",
6
6
  "typings": "./REST.d.ts",