core: fix problem add with difficulty (#683)

pull/608/merge
panda 11 months ago committed by GitHub
parent 21ff3ce8f5
commit bc4f5115d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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;

Loading…
Cancel
Save