@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/dist/index.mjs
CHANGED
|
@@ -4583,7 +4583,7 @@ function useSchoolRepo() {
|
|
|
4583
4583
|
deletedAt: { $in: ["", null] },
|
|
4584
4584
|
status
|
|
4585
4585
|
};
|
|
4586
|
-
sort = Object.keys(sort).length > 0 ? sort : {
|
|
4586
|
+
sort = Object.keys(sort).length > 0 ? sort : {};
|
|
4587
4587
|
const cacheKeyOptions = {
|
|
4588
4588
|
status,
|
|
4589
4589
|
page,
|
|
@@ -4612,12 +4612,12 @@ function useSchoolRepo() {
|
|
|
4612
4612
|
});
|
|
4613
4613
|
return cached;
|
|
4614
4614
|
}
|
|
4615
|
-
const
|
|
4616
|
-
|
|
4617
|
-
{ $sort: sort }
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4615
|
+
const pipeline = [{ $match: query }];
|
|
4616
|
+
if (Object.keys(sort).length > 0) {
|
|
4617
|
+
pipeline.push({ $sort: sort });
|
|
4618
|
+
}
|
|
4619
|
+
pipeline.push({ $skip: page * limit }, { $limit: limit });
|
|
4620
|
+
const items = await collection.aggregate(pipeline).toArray();
|
|
4621
4621
|
const length = await collection.countDocuments(query);
|
|
4622
4622
|
const data = paginate6(items, page, limit, length);
|
|
4623
4623
|
setCache(cacheKey, data, 600).then(() => {
|