mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 09:38:19 +08:00
core: fix problem copy pid
This commit is contained in:
1 parent
0aba9f8215
commit
b10c67f5cf
4 files changed
+21
-6
No files matched your search
@@ -292,13 +292,12 @@ export class ProblemDetailHandler extends ProblemHandler {
|
||||
}
|
||||
|
||||
@param('target', Types.String)
|
||||
@param('pid', Types.String, true)
|
||||
async postCopy(domainId: string, target: string, pid: string) {
|
||||
async postCopy(domainId: string, target: string) {
|
||||
const ddoc = await domain.get(target);
|
||||
if (!ddoc) throw new NotFoundError(target);
|
||||
const dudoc = await user.getById(target, this.user._id);
|
||||
if (!dudoc.hasPerm(PERM.PERM_CREATE_PROBLEM)) throw new PermissionError(PERM.PERM_CREATE_PROBLEM);
|
||||
const docId = await problem.copy(domainId, this.user.docId, target, pid);
|
||||
const docId = await problem.copy(domainId, this.user.docId, target, this.pdoc.pid);
|
||||
this.response.redirect = this.url('problem_detail', { domainId: target, pid: docId });
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user