forked from UKSOURCE/cms.lams
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:
@@ -193,12 +193,12 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
|
||||
const finalData = normalizePoliciesDocument(
|
||||
(await PoliciesPage.findOne()
|
||||
.select("-_id -__v -createdAt -updatedAt")
|
||||
.lean()) || {},
|
||||
);
|
||||
jsonHelper.writeJsonFile(policiesConfig.dataFile, finalData);
|
||||
// const finalData = normalizePoliciesDocument(
|
||||
// (await PoliciesPage.findOne()
|
||||
// .select("-_id -__v -createdAt -updatedAt")
|
||||
// .lean()) || {},
|
||||
// );
|
||||
// jsonHelper.writeJsonFile(policiesConfig.dataFile, finalData);
|
||||
|
||||
const successMessage = validation.warnings.length
|
||||
? `Policy content updated with warnings: ${validation.warnings.join(" ")}`
|
||||
|
||||
Reference in New Issue
Block a user