fix: title should not affact original file

This commit is contained in:
Methapon2001 2025-01-10 14:32:17 +07:00
parent d635ffbc66
commit 88fec3b8f2

View file

@ -210,9 +210,15 @@ export class FileController extends Controller {
copy++;
}
copyFileName = `${originalName} (${copy})` + extension;
copyFileName = `${originalName} (${copy + 1})` + extension;
const result = await updateFile(path, fileName, Object.assign(props, { title: copyFileName}), path, copyFileName);
const result = await updateFile(
path,
fileName,
{ ...props, title: copyFileName },
path,
copyFileName,
);
if (!result) {
throw new Error("เกิดข้อผิดพลาดกับระบบจัดการไฟล์ ไม่สามารถแก้ไขไฟล์ได้");