yusuketk 7 anos atrás
pai
commit
a49b855a3c

+ 1 - 1
src/server/models/page-tag-relation.js

@@ -33,7 +33,7 @@ class PageTagRelation {
 
 
   static async createIfNotExist(pageId, tagId) {
   static async createIfNotExist(pageId, tagId) {
     if (!await this.findOne({ relatedPage: pageId, relatedTag: tagId })) {
     if (!await this.findOne({ relatedPage: pageId, relatedTag: tagId })) {
-      this.create({ relatedPage: pageId, relatedTag: tagId });
+      await this.create({ relatedPage: pageId, relatedTag: tagId });
     }
     }
   }
   }
 
 

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

@@ -329,7 +329,7 @@ module.exports = function(crowi) {
     /* eslint-disable no-await-in-loop */
     /* eslint-disable no-await-in-loop */
     for (const tag of newTags) {
     for (const tag of newTags) {
       const setTag = await Tag.findOrCreate(tag);
       const setTag = await Tag.findOrCreate(tag);
-      PageTagRelation.createIfNotExist(page._id, setTag._id);
+      await PageTagRelation.createIfNotExist(page._id, setTag._id);
     }
     }
   };
   };