diff --git a/src/controllers/StorageController.ts b/src/controllers/StorageController.ts index 1c93e08..7fa711b 100644 --- a/src/controllers/StorageController.ts +++ b/src/controllers/StorageController.ts @@ -166,13 +166,14 @@ export class DocumentController extends Controller { ) { const path = ["ระบบเงินเดือน", "เอกสารอ้างอิงผังเงินเดือน", id]; - if (!(await createFolder(path, id, true))) { + if (!(await createFolder(path.slice(0, -1), id, true))) { throw new Error("เกิดข้อผิดพลาดกับระบบจัดการไฟล์ ไม่สามารถสร้างแฟ้มได้"); } + const list = await listFile(path); if (!list || !Array.isArray(list)) { - throw new Error("เกิดข้อผิดพลาดกับระบบจัดการไฟล์ ไม่สามารถสร้างแฟ้มได้"); + throw new Error("เกิดข้อผิดพลาดกับระบบจัดการไฟล์ เข้าถึงรายการไฟล์ได้"); } let used: string[] = [];