mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core: fix training.getListStatus
This commit is contained in:
1 parent
0c51e7d5f6
commit
151cc79f36
3 files changed
+5
-4
No files matched your search
@@ -43,8 +43,9 @@ String.prototype.rawformat = function rawFormat(object) {
|
||||
};
|
||||
|
||||
String.prototype.translate = function translate(...languages: string[]) {
|
||||
if (languages.length === 0) languages = ['zh_CN'];
|
||||
if (!languages.length) languages = ['zh_CN'];
|
||||
for (const language of languages) {
|
||||
if (!language) continue;
|
||||
if (locales[language]) {
|
||||
if (locales[language][this] !== undefined) return locales[language][this];
|
||||
}
|
||||
|
||||
@@ -14,10 +14,10 @@ export function getMultiStatus(domainId: string, query: FilterQuery<TrainingDoc>
|
||||
|
||||
export async function getListStatus(domainId: string, uid: number, tids: ObjectID[]) {
|
||||
const tsdocs = await getMultiStatus(
|
||||
domainId, { uid, tid: { $in: Array.from(new Set(tids)) } },
|
||||
domainId, { uid, docId: { $in: Array.from(new Set(tids)) } },
|
||||
).toArray();
|
||||
const r = {};
|
||||
for (const tsdoc of tsdocs) r[tsdoc.pid] = tsdoc;
|
||||
for (const tsdoc of tsdocs) r[tsdoc.docId] = tsdoc;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user