core: fix contest export for file submission

pull/590/head
undefined 1 year ago
parent 7b4083e4c6
commit 93bf79e6ad
No known key found for this signature in database

@ -536,7 +536,7 @@ export class ContestCodeHandler extends Handler {
if (!id) return; if (!id) return;
zip.addFile( zip.addFile(
`${rnames[rdoc._id.toHexString()]}.${filename || 'txt'}`, `${rnames[rdoc._id.toHexString()]}.${filename || 'txt'}`,
await streamToBuffer(storage.get(id)), await streamToBuffer(await storage.get(`submission/${id}`)),
); );
} else if (rdoc.code) { } else if (rdoc.code) {
zip.addFile(`${rnames[rdoc._id.toHexString()]}.${rdoc.lang}`, Buffer.from(rdoc.code)); zip.addFile(`${rnames[rdoc._id.toHexString()]}.${rdoc.lang}`, Buffer.from(rdoc.code));

Loading…
Cancel
Save