|
@@ -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');
|