takeru0001 %!s(int64=5) %!d(string=hai) anos
pai
achega
8ad5660ff5
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/server/models/page.js

+ 2 - 1
src/server/models/page.js

@@ -1303,6 +1303,7 @@ module.exports = function(crowi) {
   };
 
   pageSchema.statics.duplicate = async function(page, newPagePath, user) {
+    const Page = this;
     // populate
     await page.populate({ path: 'revision', model: 'Revision', select: 'body' }).execPopulate();
 
@@ -1312,7 +1313,7 @@ module.exports = function(crowi) {
     options.grantUserGroupId = page.grantedGroup;
     options.grantedUsers = page.grantedUsers;
 
-    const createdPage = await createPageAction({
+    const createdPage = await Page.create({
       path: newPagePath, user, body: page.revision.body, options,
     });