diff --git a/src/controllers/FileController.ts b/src/controllers/FileController.ts index 3e70545..4e1b501 100644 --- a/src/controllers/FileController.ts +++ b/src/controllers/FileController.ts @@ -695,7 +695,22 @@ export class SubFileController extends Controller { @Path() subId: 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) { throw new Error("เกิดข้อผิดพลาดกับระบบจัดการไฟล์ ไม่สามารถลบไฟล์ ได้");