remult 0.23.0-exp.10 → 0.23.0-exp.11
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/esm/src/sort.js +4 -1
- package/package.json +1 -1
- package/src/sort.js +4 -1
package/esm/src/sort.js
CHANGED
|
@@ -44,6 +44,8 @@ export class Sort {
|
|
|
44
44
|
return r;
|
|
45
45
|
}
|
|
46
46
|
static translateOrderByToSort(entityDefs, orderBy) {
|
|
47
|
+
if (!orderBy)
|
|
48
|
+
return undefined;
|
|
47
49
|
let sort = new Sort();
|
|
48
50
|
if (orderBy)
|
|
49
51
|
for (const key in orderBy) {
|
|
@@ -85,7 +87,8 @@ export class Sort {
|
|
|
85
87
|
return sort;
|
|
86
88
|
}
|
|
87
89
|
static createUniqueSort(entityMetadata, orderBy) {
|
|
88
|
-
if (!orderBy || Object.keys(orderBy).length === 0)
|
|
90
|
+
if ((!orderBy || Object.keys(orderBy).length === 0) &&
|
|
91
|
+
entityMetadata.options.defaultOrderBy)
|
|
89
92
|
orderBy = Sort.translateOrderByToSort(entityMetadata, entityMetadata.options.defaultOrderBy);
|
|
90
93
|
if (!orderBy)
|
|
91
94
|
orderBy = new Sort({ field: entityMetadata.idMetadata.field });
|
package/package.json
CHANGED
package/src/sort.js
CHANGED
|
@@ -73,6 +73,8 @@ var Sort = /** @class */ (function () {
|
|
|
73
73
|
return r;
|
|
74
74
|
};
|
|
75
75
|
Sort.translateOrderByToSort = function (entityDefs, orderBy) {
|
|
76
|
+
if (!orderBy)
|
|
77
|
+
return undefined;
|
|
76
78
|
var sort = new Sort();
|
|
77
79
|
if (orderBy) {
|
|
78
80
|
var _loop_1 = function (key) {
|
|
@@ -119,7 +121,8 @@ var Sort = /** @class */ (function () {
|
|
|
119
121
|
};
|
|
120
122
|
Sort.createUniqueSort = function (entityMetadata, orderBy) {
|
|
121
123
|
var e_3, _a;
|
|
122
|
-
if (!orderBy || Object.keys(orderBy).length === 0)
|
|
124
|
+
if ((!orderBy || Object.keys(orderBy).length === 0) &&
|
|
125
|
+
entityMetadata.options.defaultOrderBy)
|
|
123
126
|
orderBy = Sort.translateOrderByToSort(entityMetadata, entityMetadata.options.defaultOrderBy);
|
|
124
127
|
if (!orderBy)
|
|
125
128
|
orderBy = new Sort({ field: entityMetadata.idMetadata.field });
|