core: allow pin training

This commit is contained in:
undefined committed 2021-06-18 19:04:48 +08:00
1 parent 6607a36856
commit a7f364e651
10 files changed
+51 -25

No files matched your search

+1
View File
@@ -85,6 +85,7 @@ export const PERM = {
PERM_VIEW_TRAINING: 1n << 46n,
PERM_CREATE_TRAINING: 1n << 47n,
PERM_EDIT_TRAINING: 1n << 48n,
PERM_PIN_TRAINING: 1n << 63n,
PERM_EDIT_TRAINING_SELF: 1n << 49n,
// Ranking
+1 -1
View File
@@ -114,7 +114,7 @@ export async function getList(domainId: string, tids: ObjectID[]) {
}
export const getMulti = (domainId: string, query: FilterQuery<TrainingDoc> = {}) =>
document.getMulti(domainId, document.TYPE_TRAINING, query).sort('_id', 1);
document.getMulti(domainId, document.TYPE_TRAINING, query).sort({ pin: -1, _id: -1 });
global.Hydro.model.training = {
getPids,