Fix unintent subfolder creation

This commit is contained in:
Methapon2001 2024-02-16 09:33:10 +07:00
parent 2de3fdb81d
commit 87306f1dce
No known key found for this signature in database
GPG key ID: 849924FEF46BD132

View file

@ -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[] = [];