|
@@ -119,7 +119,7 @@ module.exports = (crowi) => {
|
|
|
const globalNotificationService = crowi.getGlobalNotificationService();
|
|
const globalNotificationService = crowi.getGlobalNotificationService();
|
|
|
const userNotificationService = crowi.getUserNotificationService();
|
|
const userNotificationService = crowi.getUserNotificationService();
|
|
|
|
|
|
|
|
- const { pageService } = crowi;
|
|
|
|
|
|
|
+ const { serializePageSecurely } = require('../../models/serializers/page-serializer');
|
|
|
|
|
|
|
|
const validator = {
|
|
const validator = {
|
|
|
createPage: [
|
|
createPage: [
|
|
@@ -230,7 +230,7 @@ module.exports = (crowi) => {
|
|
|
|
|
|
|
|
const savedTags = await saveTagsAction({ createdPage, pageTags });
|
|
const savedTags = await saveTagsAction({ createdPage, pageTags });
|
|
|
|
|
|
|
|
- const result = { page: pageService.serializeToObj(createdPage), tags: savedTags };
|
|
|
|
|
|
|
+ const result = { page: serializePageSecurely(createdPage), tags: savedTags };
|
|
|
|
|
|
|
|
// update scopes for descendants
|
|
// update scopes for descendants
|
|
|
if (overwriteScopesOfDescendants) {
|
|
if (overwriteScopesOfDescendants) {
|
|
@@ -406,7 +406,7 @@ module.exports = (crowi) => {
|
|
|
return res.apiv3Err(new ErrorV3('Failed to update page.', 'unknown'), 500);
|
|
return res.apiv3Err(new ErrorV3('Failed to update page.', 'unknown'), 500);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const result = { page: pageService.serializeToObj(page) };
|
|
|
|
|
|
|
+ const result = { page: serializePageSecurely(page) };
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
// global notification
|
|
// global notification
|
|
@@ -503,7 +503,7 @@ module.exports = (crowi) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return { page: pageService.serializeToObj(createdPage), tags: savedTags };
|
|
|
|
|
|
|
+ return { page: serializePageSecurely(createdPage), tags: savedTags };
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async function duplicatePageRecursively(page, newPagePath, user) {
|
|
async function duplicatePageRecursively(page, newPagePath, user) {
|