mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: better training validation output
This commit is contained in:
1 parent
9a44422522
commit
6bda0e58d3
9 files changed
+13
-6
No files matched your search
@@ -202,6 +202,7 @@ export class ProblemModel {
|
||||
static async copy(domainId: string, _id: number, target: string, pid?: string) {
|
||||
const original = await ProblemModel.get(domainId, _id);
|
||||
if (!original) throw new ProblemNotFoundError(domainId, _id);
|
||||
// TODO: refuse to copy referenced problem
|
||||
if (pid && (/^[0-9]+$/.test(pid) || await ProblemModel.get(target, pid))) pid = '';
|
||||
if (!pid && original.pid && !await ProblemModel.get(target, original.pid)) pid = original.pid;
|
||||
const docId = await ProblemModel.add(
|
||||
|
||||
Reference in new issue
Block a user