Browse Source

update comment

ryoji-s 2 years ago
parent
commit
e4ccc3c18e

+ 2 - 1
apps/app/src/components/Bookmarks/BookmarkFolderItem.tsx

@@ -159,7 +159,8 @@ export const BookmarkFolderItem: FC<BookmarkFolderItemProps> = (props: BookmarkF
       }
       }
 
 
       // Maximum folder hierarchy of 2 levels
       // Maximum folder hierarchy of 2 levels
-      // Check source folder has no chidren or dest folder has no parent
+      // If the drop source folder has child folders, the drop source folder cannot be moved because the drop source folder hierarchy is already 2.
+      // If the destination folder has a parent, the source folder cannot be moved because the destination folder hierarchy is already 2.
       if (item.bookmarkFolder.children.length !== 0 || bookmarkFolder.parent != null) {
       if (item.bookmarkFolder.children.length !== 0 || bookmarkFolder.parent != null) {
         return false;
         return false;
       }
       }

+ 2 - 1
apps/app/src/server/models/bookmark-folder.ts

@@ -157,7 +157,8 @@ bookmarkFolderSchema.statics.updateBookmarkFolder = async function(bookmarkFolde
   updateFields.parent = parentFolder?._id ?? null;
   updateFields.parent = parentFolder?._id ?? null;
 
 
   // Maximum folder hierarchy of 2 levels
   // Maximum folder hierarchy of 2 levels
-  // Check source folder has no chidren or dest folder has no parent
+  // If the destination folder (parentFolder) has a parent, the source folder cannot be moved because the destination folder hierarchy is already 2.
+  // If the drop source folder has child folders, the drop source folder cannot be moved because the drop source folder hierarchy is already 2.
   if (parentId != null) {
   if (parentId != null) {
     if (parentFolder?.parent != null) {
     if (parentFolder?.parent != null) {
       throw new Error('Update bookmark folder failed');
       throw new Error('Update bookmark folder failed');