core: bug fixes

This commit is contained in:
undefined committed 2024-01-08 16:45:23 +08:00
1 parent 5369d8d5eb
commit b027505512
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -807,8 +807,8 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
@post('std', Types.Filename)
@post('gen', Types.Filename)
async postGenerateTestdata(domainId: string, std: string, gen: string) {
if (!this.pdoc.data.find((i) => i.name === std)) throw new BadRequestError();
if (!this.pdoc.data.find((i) => i.name === gen)) throw new BadRequestError();
if (!this.pdoc.data?.find((i) => i.name === std)) throw new BadRequestError();
if (!this.pdoc.data?.find((i) => i.name === gen)) throw new BadRequestError();
const rid = await record.add(domainId, this.pdoc.docId, this.user._id, '_', `${gen}\n${std}`, true, {
type: 'generate',
});