chore(controllers): disable json file writing on page content updates

Disable the automatic writing of data to JSON files in `createPageContentController`, `admissionsController`, and `policiesController` to prevent redundant file system operations during updates.
This commit is contained in:
Tống Thành Đạt
2026-04-23 13:43:53 +07:00
parent e9356be04c
commit 7e01fba2c3
3 changed files with 16 additions and 16 deletions
+5 -5
View File
@@ -75,11 +75,11 @@ function createPageContentController({
});
}
const finalData = await model
.findOne()
.select("-_id -__v -createdAt -updatedAt")
.lean();
jsonHelper.writeJsonFile(editorConfig.dataFile, finalData);
// const finalData = await model
// .findOne()
// .select("-_id -__v -createdAt -updatedAt")
// .lean();
// jsonHelper.writeJsonFile(editorConfig.dataFile, finalData);
req.flash("success_msg", `${editorConfig.title} updated successfully`);
return req.session.save(() =>