Skip to content

Commit 92fa58e

Browse files
committed
Fix folder move from root to subfolder
1 parent d847f57 commit 92fa58e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/home/FolderController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.lowcoder.api.util.GidService;
99
import org.lowcoder.domain.application.model.ApplicationType;
1010
import org.lowcoder.domain.folder.model.Folder;
11+
import org.lowcoder.domain.folder.model.FolderElement;
1112
import org.lowcoder.domain.folder.service.FolderElementRelationService;
1213
import org.lowcoder.domain.folder.service.FolderService;
1314
import org.lowcoder.domain.permission.model.ResourceRole;
@@ -92,7 +93,7 @@ public Mono<PageResponseView<?>> getElements(@RequestParam(value = "id", require
9293
@Override
9394
public Mono<ResponseView<Void>> move(@PathVariable("id") String applicationLikeId,
9495
@RequestParam(value = "targetFolderId", required = false) String targetFolderId) {
95-
return folderElementRelationService.getByElementIds(List.of(applicationLikeId)).next().flatMap(folderElement ->
96+
return folderElementRelationService.getByElementIds(List.of(applicationLikeId)).next().defaultIfEmpty(new FolderElement(null, null)).flatMap(folderElement ->
9697
gidService.convertFolderIdToObjectId(targetFolderId).flatMap(objectId ->
9798
folderApiService.move(applicationLikeId, objectId.orElse(null))
9899
.then(businessEventPublisher.publishApplicationCommonEvent(applicationLikeId, folderElement.folderId(), objectId.orElse(null), APPLICATION_MOVE))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy