core: api: problems: ensure return order matches query

This commit is contained in:
undefined committed 2025-08-28 01:06:43 +08:00
1 parent 0ddcee7336
commit 727b29d7a4
1 file changed
+1 -1
+1 -1
View File
@@ -1044,7 +1044,7 @@ export const ProblemApi = {
async (ctx, args) => {
const pdocs = await problem.getList(args.domainId, args.ids, ctx.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || ctx.user._id,
undefined, undefined, true);
return Object.keys(pdocs).map((id) => pdocs[+id]);
return args.ids.map((id) => pdocs[+id]).filter((i) => i);
},
),
} as const;