mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: sort home page training with pin (#398)
This commit is contained in:
1 parent
662ad7cd45
commit
8648929063
2 files changed
+2
-2
No files matched your search
@@ -65,7 +65,7 @@ export class HomeHandler extends Handler {
|
||||
async getTraining(domainId: string, limit = 10) {
|
||||
if (this.user.hasPerm(PERM.PERM_VIEW_TRAINING)) {
|
||||
const tdocs = await training.getMulti(domainId)
|
||||
.sort('_id', 1).limit(limit).toArray();
|
||||
.sort({ pin: -1, _id: 1 }).limit(limit).toArray();
|
||||
const tsdict = await training.getListStatus(
|
||||
domainId, this.user._id, tdocs.map((tdoc) => tdoc.docId),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user