backendless 6.6.2 → 6.6.3
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/dist/backendless.js +13 -10
- package/dist/backendless.js.map +1 -1
- package/dist/backendless.min.js +2 -2
- package/es/data/store.js +12 -9
- package/lib/data/store.js +12 -9
- package/package.json +1 -1
- package/src/data/store.js +3 -1
package/es/data/store.js
CHANGED
|
@@ -419,46 +419,49 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
419
419
|
key: "getObjectCount",
|
|
420
420
|
value: function () {
|
|
421
421
|
var _getObjectCount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(condition) {
|
|
422
|
-
var distinct;
|
|
422
|
+
var distinct, groupBy;
|
|
423
423
|
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
424
424
|
while (1) {
|
|
425
425
|
switch (_context10.prev = _context10.next) {
|
|
426
426
|
case 0:
|
|
427
427
|
distinct = undefined;
|
|
428
|
+
groupBy = undefined;
|
|
428
429
|
|
|
429
430
|
if (!condition) {
|
|
430
|
-
_context10.next =
|
|
431
|
+
_context10.next = 11;
|
|
431
432
|
break;
|
|
432
433
|
}
|
|
433
434
|
|
|
434
435
|
if (!(condition instanceof _dataQueryBuilder["default"])) {
|
|
435
|
-
_context10.next =
|
|
436
|
+
_context10.next = 9;
|
|
436
437
|
break;
|
|
437
438
|
}
|
|
438
439
|
|
|
439
440
|
distinct = condition.getDistinct() || undefined;
|
|
441
|
+
groupBy = condition.getGroupBy() || undefined;
|
|
440
442
|
condition = condition.getWhereClause() || undefined;
|
|
441
|
-
_context10.next =
|
|
443
|
+
_context10.next = 11;
|
|
442
444
|
break;
|
|
443
445
|
|
|
444
|
-
case
|
|
446
|
+
case 9:
|
|
445
447
|
if (!(typeof condition !== 'string')) {
|
|
446
|
-
_context10.next =
|
|
448
|
+
_context10.next = 11;
|
|
447
449
|
break;
|
|
448
450
|
}
|
|
449
451
|
|
|
450
452
|
throw new Error('Condition must be a string or an instance of DataQueryBuilder.');
|
|
451
453
|
|
|
452
|
-
case
|
|
454
|
+
case 11:
|
|
453
455
|
return _context10.abrupt("return", this.app.request.post({
|
|
454
456
|
url: this.app.urls.dataTableCount(this.className),
|
|
455
457
|
data: {
|
|
456
458
|
where: condition,
|
|
457
|
-
distinct: distinct
|
|
459
|
+
distinct: distinct,
|
|
460
|
+
groupBy: groupBy
|
|
458
461
|
}
|
|
459
462
|
}));
|
|
460
463
|
|
|
461
|
-
case
|
|
464
|
+
case 12:
|
|
462
465
|
case "end":
|
|
463
466
|
return _context10.stop();
|
|
464
467
|
}
|
package/lib/data/store.js
CHANGED
|
@@ -419,46 +419,49 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
419
419
|
key: "getObjectCount",
|
|
420
420
|
value: function () {
|
|
421
421
|
var _getObjectCount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(condition) {
|
|
422
|
-
var distinct;
|
|
422
|
+
var distinct, groupBy;
|
|
423
423
|
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
424
424
|
while (1) {
|
|
425
425
|
switch (_context10.prev = _context10.next) {
|
|
426
426
|
case 0:
|
|
427
427
|
distinct = undefined;
|
|
428
|
+
groupBy = undefined;
|
|
428
429
|
|
|
429
430
|
if (!condition) {
|
|
430
|
-
_context10.next =
|
|
431
|
+
_context10.next = 11;
|
|
431
432
|
break;
|
|
432
433
|
}
|
|
433
434
|
|
|
434
435
|
if (!(condition instanceof _dataQueryBuilder["default"])) {
|
|
435
|
-
_context10.next =
|
|
436
|
+
_context10.next = 9;
|
|
436
437
|
break;
|
|
437
438
|
}
|
|
438
439
|
|
|
439
440
|
distinct = condition.getDistinct() || undefined;
|
|
441
|
+
groupBy = condition.getGroupBy() || undefined;
|
|
440
442
|
condition = condition.getWhereClause() || undefined;
|
|
441
|
-
_context10.next =
|
|
443
|
+
_context10.next = 11;
|
|
442
444
|
break;
|
|
443
445
|
|
|
444
|
-
case
|
|
446
|
+
case 9:
|
|
445
447
|
if (!(typeof condition !== 'string')) {
|
|
446
|
-
_context10.next =
|
|
448
|
+
_context10.next = 11;
|
|
447
449
|
break;
|
|
448
450
|
}
|
|
449
451
|
|
|
450
452
|
throw new Error('Condition must be a string or an instance of DataQueryBuilder.');
|
|
451
453
|
|
|
452
|
-
case
|
|
454
|
+
case 11:
|
|
453
455
|
return _context10.abrupt("return", this.app.request.post({
|
|
454
456
|
url: this.app.urls.dataTableCount(this.className),
|
|
455
457
|
data: {
|
|
456
458
|
where: condition,
|
|
457
|
-
distinct: distinct
|
|
459
|
+
distinct: distinct,
|
|
460
|
+
groupBy: groupBy
|
|
458
461
|
}
|
|
459
462
|
}));
|
|
460
463
|
|
|
461
|
-
case
|
|
464
|
+
case 12:
|
|
462
465
|
case "end":
|
|
463
466
|
return _context10.stop();
|
|
464
467
|
}
|
package/package.json
CHANGED
package/src/data/store.js
CHANGED
|
@@ -166,10 +166,12 @@ export default class DataStore {
|
|
|
166
166
|
|
|
167
167
|
async getObjectCount(condition) {
|
|
168
168
|
let distinct = undefined
|
|
169
|
+
let groupBy = undefined
|
|
169
170
|
|
|
170
171
|
if (condition) {
|
|
171
172
|
if (condition instanceof DataQueryBuilder) {
|
|
172
173
|
distinct = condition.getDistinct() || undefined
|
|
174
|
+
groupBy = condition.getGroupBy() || undefined
|
|
173
175
|
condition = condition.getWhereClause() || undefined
|
|
174
176
|
} else if (typeof condition !== 'string') {
|
|
175
177
|
throw new Error('Condition must be a string or an instance of DataQueryBuilder.')
|
|
@@ -178,7 +180,7 @@ export default class DataStore {
|
|
|
178
180
|
|
|
179
181
|
return this.app.request.post({
|
|
180
182
|
url : this.app.urls.dataTableCount(this.className),
|
|
181
|
-
data: { where: condition, distinct },
|
|
183
|
+
data: { where: condition, distinct, groupBy },
|
|
182
184
|
})
|
|
183
185
|
}
|
|
184
186
|
|