@eeplatform/basic-edu 1.3.6 → 1.3.7
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/CHANGELOG.md +6 -0
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -4573,7 +4573,7 @@ function useSchoolRepo() {
|
|
|
4573
4573
|
deletedAt: { $in: ["", null] },
|
|
4574
4574
|
status
|
|
4575
4575
|
};
|
|
4576
|
-
sort = Object.keys(sort).length > 0 ? sort : {
|
|
4576
|
+
sort = Object.keys(sort).length > 0 ? sort : {};
|
|
4577
4577
|
const cacheKeyOptions = {
|
|
4578
4578
|
status,
|
|
4579
4579
|
page,
|
|
@@ -4602,12 +4602,12 @@ function useSchoolRepo() {
|
|
|
4602
4602
|
});
|
|
4603
4603
|
return cached;
|
|
4604
4604
|
}
|
|
4605
|
-
const
|
|
4606
|
-
|
|
4607
|
-
{ $sort: sort }
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4605
|
+
const pipeline = [{ $match: query }];
|
|
4606
|
+
if (Object.keys(sort).length > 0) {
|
|
4607
|
+
pipeline.push({ $sort: sort });
|
|
4608
|
+
}
|
|
4609
|
+
pipeline.push({ $skip: page * limit }, { $limit: limit });
|
|
4610
|
+
const items = await collection.aggregate(pipeline).toArray();
|
|
4611
4611
|
const length = await collection.countDocuments(query);
|
|
4612
4612
|
const data = (0, import_nodejs_utils17.paginate)(items, page, limit, length);
|
|
4613
4613
|
setCache(cacheKey, data, 600).then(() => {
|