feat: handle replace
This commit is contained in:
parent
a6295586f8
commit
6306e0266d
2 changed files with 23 additions and 15 deletions
|
|
@ -192,7 +192,7 @@ export class FileController extends Controller {
|
|||
const ret = await Promise.all(
|
||||
body.fileList.map(async ({ fileName }) => [
|
||||
fileName,
|
||||
await s3UploadFile(...path, fileName),
|
||||
await s3UploadFile(!!body.replace, ...path, fileName),
|
||||
]),
|
||||
);
|
||||
return Object.fromEntries(ret);
|
||||
|
|
@ -519,7 +519,13 @@ export class SubFileController extends Controller {
|
|||
const path = [name, group, id, subId];
|
||||
|
||||
if (name !== "ระบบประเมิน") {
|
||||
return await s3ListFile(name, group, id, subId);
|
||||
const ret = await Promise.all(
|
||||
body.fileList.map(async ({ fileName }) => [
|
||||
fileName,
|
||||
await s3UploadFile(!!body.replace, ...path, fileName),
|
||||
]),
|
||||
);
|
||||
return Object.fromEntries(ret);
|
||||
}
|
||||
|
||||
if (!(await createFolder(path.slice(0, -1), subId, true))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue