mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
add training files
This commit is contained in:
1 parent
3600aff598
commit
dc0e397d77
11 files changed
+169
-9
No files matched your search
@@ -552,7 +552,7 @@ export class ContestFilesHandler extends ContestDetailBaseHandler {
|
||||
if (filename.includes('/') || filename.includes('..')) throw new ValidationError('filename', null, 'Bad filename');
|
||||
await storage.put(`contest/${domainId}/${tid}/${filename}`, file.filepath, this.user._id);
|
||||
const meta = await storage.getMeta(`contest/${domainId}/${tid}/${filename}`);
|
||||
const payload = { name: filename, ...pick(meta, ['size', 'lastModified', 'etag']) };
|
||||
const payload = { _id: filename, name: filename, ...pick(meta, ['size', 'lastModified', 'etag']) };
|
||||
if (!meta) throw new FileUploadError();
|
||||
await contest.edit(domainId, tid, { files: [...(this.tdoc.files || []), payload] });
|
||||
this.back();
|
||||
|
||||
Reference in new issue
Block a user