fix delete file s3
This commit is contained in:
parent
aaf7944f01
commit
c87ae27070
1 changed files with 16 additions and 1 deletions
|
|
@ -695,7 +695,22 @@ export class SubFileController extends Controller {
|
||||||
@Path() subId: string,
|
@Path() subId: string,
|
||||||
@Path() file: string,
|
@Path() file: string,
|
||||||
) {
|
) {
|
||||||
const result = await deleteFile([name, group, id, subId], file);
|
if (name !== "ระบบประเมิน") {
|
||||||
|
const rawPath = [
|
||||||
|
name,
|
||||||
|
group,
|
||||||
|
id,
|
||||||
|
file
|
||||||
|
];
|
||||||
|
const fullPath = rawPath
|
||||||
|
.filter((path) => path !== undefined && path !== null)
|
||||||
|
.join("/");
|
||||||
|
|
||||||
|
const path = fullPath;
|
||||||
|
return await s3DeleteFile(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = await deleteFile([name, group, id, subId], file);
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
throw new Error("เกิดข้อผิดพลาดกับระบบจัดการไฟล์ ไม่สามารถลบไฟล์ ได้");
|
throw new Error("เกิดข้อผิดพลาดกับระบบจัดการไฟล์ ไม่สามารถลบไฟล์ ได้");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue