core: fix problem add with difficulty (#683)

This commit is contained in:
panda authored and GitHub committed 2023-11-05 06:00:59 +08:00
1 parent 21ff3ce8f5
commit bc4f5115d2
1 file changed
+1
+1
View File
@@ -140,6 +140,7 @@ export class ProblemModel {
title, tag, hidden: meta.hidden || false, nSubmit: 0, nAccept: 0, sort: sortable(pid || `P${docId}`),
};
if (pid) args.pid = pid;
if (meta.difficulty) args.difficulty = meta.difficulty;
await bus.parallel('problem/before-add', domainId, content, owner, docId, args);
const result = await document.add(domainId, content, owner, document.TYPE_PROBLEM, docId, null, null, args);
args.content = content;