Sfoglia il codice sorgente

adjust method name

takeru0001 5 anni fa
parent
commit
d4fa5c69b5
2 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. 3 3
      src/server/models/page.js
  2. 2 2
      src/server/routes/apiv3/page.js

+ 3 - 3
src/server/models/page.js

@@ -258,7 +258,7 @@ class PageQueryBuilder {
     return this;
   }
 
-  addConditionToArrayExistPaths(paths) {
+  addConditionToListByPathsArray(paths) {
     this.query = this.query
       .and({
         path: {
@@ -1302,9 +1302,9 @@ module.exports = function(crowi) {
     return targetPage;
   };
 
-  pageSchema.statics.findExisitPath = async function(paths) {
+  pageSchema.statics.findListByPathsArray = async function(paths) {
     const queryBuilder = new PageQueryBuilder(this.find());
-    queryBuilder.addConditionToArrayExistPaths(paths);
+    queryBuilder.addConditionToListByPathsArray(paths);
 
     return await queryBuilder.query.exec();
   };

+ 2 - 2
src/server/routes/apiv3/page.js

@@ -298,11 +298,11 @@ module.exports = (crowi) => {
       const fromPage = await Page.findByPath(fromPath);
       const fromPageDescendants = await Page.findManageableListWithDescendants(fromPage, req.user);
 
-      const fromPathDescendantsArray = fromPageDescendants.map((subordinatedPage) => {
+      const toPathDescendantsArray = fromPageDescendants.map((subordinatedPage) => {
         return convertToNewAffiliationPath(fromPath, toPath, subordinatedPage.path);
       });
 
-      const existPages = await Page.findExisitPath(fromPathDescendantsArray);
+      const existPages = await Page.findListByPathsArray(toPathDescendantsArray);
       const existPaths = existPages.map(page => page.path);
 
       return res.apiv3({ existPaths });