From 727b29d7a49e80a98ba0614db657f07640443ee4 Mon Sep 17 00:00:00 2001 From: undefined Date: Wed, 27 Aug 2025 03:23:59 +0800 Subject: [PATCH] core: api: problems: ensure return order matches query --- packages/hydrooj/src/handler/problem.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index 3a993eb1f..e2c105046 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -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;