@provis/provis-common-be-module 2.6.76 → 2.6.77
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.
|
@@ -44,7 +44,7 @@ class MainRepository extends typeorm_1.Repository {
|
|
|
44
44
|
throw new Error('Model name is not set yet');
|
|
45
45
|
}
|
|
46
46
|
orderBy() {
|
|
47
|
-
return '
|
|
47
|
+
return 'id';
|
|
48
48
|
}
|
|
49
49
|
aliasTable() {
|
|
50
50
|
return this.modelName();
|
|
@@ -133,7 +133,7 @@ class MainRepository extends typeorm_1.Repository {
|
|
|
133
133
|
return query.getRawOne();
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
findAllAndCount({ search, additionalSearchOr, relations, subqueryIns, sortBy, offset = 1, maxCount = 50, }) {
|
|
136
|
+
findAllAndCount({ search, additionalSearchOr, relations, subqueryIns, sortBy = 'id.DESC', offset = 1, maxCount = 50, }) {
|
|
137
137
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
138
|
const skipItems = ((offset < 1 ? 1 : offset) - 1) * maxCount;
|
|
139
139
|
let query = this.createQueryBuilder().select(this.selectFieldOnFindAllAndCount());
|
|
@@ -351,7 +351,7 @@ class MainRepository extends typeorm_1.Repository {
|
|
|
351
351
|
const offset = (page - 1) * limit;
|
|
352
352
|
const rawQueryWithFilter = rawQuery;
|
|
353
353
|
const rawCount = this.generateRawCount(rawQueryWithFilter);
|
|
354
|
-
const rawOrder = this.generateRawOrder(orderBy);
|
|
354
|
+
const rawOrder = this.generateRawOrder(orderBy || 'id.DESC');
|
|
355
355
|
const [countResult, dataResult] = yield Promise.all([
|
|
356
356
|
manager.query(rawCount),
|
|
357
357
|
manager.query(`${rawQueryWithFilter} ${rawOrder} LIMIT $1 OFFSET $2`, [limit, offset]),
|