fix: Update refactored entity by branched id (#28741)

This commit is contained in:
subratadeypappu 2023-11-09 13:49:35 +06:00 committed by GitHub
parent c0cd0f24cc
commit e64f7f3e14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,14 +114,15 @@ public class NewActionRefactoringServiceCEImpl implements EntityRefactoringServi
@Override
public Mono<Void> updateRefactoredEntity(RefactorEntityNameDTO refactorEntityNameDTO, String branchName) {
return newActionService
.findActionDTObyIdAndViewMode(
refactorEntityNameDTO.getActionId(), false, actionPermission.getEditPermission())
.findByBranchNameAndDefaultActionId(
branchName, refactorEntityNameDTO.getActionId(), actionPermission.getEditPermission())
.flatMap(branchedAction -> newActionService.generateActionByViewMode(branchedAction, false))
.flatMap(action -> {
action.setName(refactorEntityNameDTO.getNewName());
if (StringUtils.hasLength(refactorEntityNameDTO.getCollectionName())) {
action.setFullyQualifiedName(refactorEntityNameDTO.getNewFullyQualifiedName());
}
return newActionService.updateUnpublishedAction(refactorEntityNameDTO.getActionId(), action);
return newActionService.updateUnpublishedAction(action.getId(), action);
})
.then();
}