|
@@ -1,4 +1,3 @@
|
|
|
-
|
|
|
|
|
import { SupportedAction } from '~/interfaces/activity';
|
|
import { SupportedAction } from '~/interfaces/activity';
|
|
|
import { AttachmentType } from '~/server/interfaces/attachment';
|
|
import { AttachmentType } from '~/server/interfaces/attachment';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
import loggerFactory from '~/utils/logger';
|
|
@@ -452,6 +451,7 @@ module.exports = function(crowi, app) {
|
|
|
api.add = async function(req, res) {
|
|
api.add = async function(req, res) {
|
|
|
let pageId = req.body.page_id || null;
|
|
let pageId = req.body.page_id || null;
|
|
|
const pagePath = req.body.path || null;
|
|
const pagePath = req.body.path || null;
|
|
|
|
|
+ const pageBody = req.body.page_body || null;
|
|
|
let pageCreated = false;
|
|
let pageCreated = false;
|
|
|
|
|
|
|
|
// check params
|
|
// check params
|
|
@@ -471,7 +471,7 @@ module.exports = function(crowi, app) {
|
|
|
const isAclEnabled = crowi.aclService.isAclEnabled();
|
|
const isAclEnabled = crowi.aclService.isAclEnabled();
|
|
|
const grant = isAclEnabled ? Page.GRANT_OWNER : Page.GRANT_PUBLIC;
|
|
const grant = isAclEnabled ? Page.GRANT_OWNER : Page.GRANT_PUBLIC;
|
|
|
|
|
|
|
|
- page = await crowi.pageService.create(pagePath, `# ${pagePath}`, req.user, { grant });
|
|
|
|
|
|
|
+ page = await crowi.pageService.create(pagePath, pageBody ?? '', req.user, { grant });
|
|
|
pageCreated = true;
|
|
pageCreated = true;
|
|
|
pageId = page._id;
|
|
pageId = page._id;
|
|
|
}
|
|
}
|