From e64f7f3e141549aa022e63fdf5e8f7d1c652e435 Mon Sep 17 00:00:00 2001 From: subratadeypappu Date: Thu, 9 Nov 2023 13:49:35 +0600 Subject: [PATCH] fix: Update refactored entity by branched id (#28741) --- .../refactors/NewActionRefactoringServiceCEImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/refactors/NewActionRefactoringServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/refactors/NewActionRefactoringServiceCEImpl.java index 3b1835772a..aeeb26b15f 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/refactors/NewActionRefactoringServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/refactors/NewActionRefactoringServiceCEImpl.java @@ -114,14 +114,15 @@ public class NewActionRefactoringServiceCEImpl implements EntityRefactoringServi @Override public Mono 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(); }