core&ui: add problems gql to fix autocomplete (#389)

This commit is contained in:
panda authored and GitHub committed 2022-07-21 20:59:36 +08:00
1 parent 4b3c57549a
commit a52c488e23
5 files changed
+17 -5

No files matched your search

+5
View File
@@ -80,6 +80,11 @@ registerResolver(
return pdoc;
},
);
registerResolver('Query', 'problems(ids: [Int])', '[Problem]', async (arg, ctx) => {
const res = await problem.getList(ctx.args.domainId, arg.ids, ctx.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || ctx.user._id,
ctx.user.group, undefined, undefined, true);
return Object.keys(res).map((id) => res[+id]);
}, 'Get a list of problem by ids');
registerResolver(
'Problem', 'manage', 'ProblemManage',
(arg, ctx) => {