diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationTemplateControllerCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationTemplateControllerCE.java index 105e54adfc..9e9ad013e9 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationTemplateControllerCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationTemplateControllerCE.java @@ -66,7 +66,7 @@ public class ApplicationTemplateControllerCE { } @PostMapping("{templateId}/merge/{applicationId}/{organizationId}") - public Mono> mergeTemplateWithApplication(@PathVariable String templateId, + public Mono> mergeTemplateWithApplication(@PathVariable String templateId, @PathVariable String applicationId, @PathVariable String organizationId, @RequestHeader(name = FieldName.BRANCH_NAME, required = false) String branchName, diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationTemplateServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationTemplateServiceCE.java index f1e76f7147..ac1cac12e2 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationTemplateServiceCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationTemplateServiceCE.java @@ -1,6 +1,5 @@ package com.appsmith.server.services.ce; -import com.appsmith.server.domains.Application; import com.appsmith.server.dtos.ApplicationImportDTO; import com.appsmith.server.dtos.ApplicationTemplate; import org.springframework.util.MultiValueMap; @@ -21,7 +20,7 @@ public interface ApplicationTemplateServiceCE { Mono importApplicationFromTemplate(String templateId, String workspaceId); - Mono mergeTemplateWithApplication(String templateId, String applicationId, String workspaceId, String branchName, List pagesToImport); + Mono mergeTemplateWithApplication(String templateId, String applicationId, String workspaceId, String branchName, List pagesToImport); Mono getFilters(); } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationTemplateServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationTemplateServiceCEImpl.java index 6a93fc9823..9a42773326 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationTemplateServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationTemplateServiceCEImpl.java @@ -236,11 +236,13 @@ public class ApplicationTemplateServiceCEImpl implements ApplicationTemplateServ } @Override - public Mono mergeTemplateWithApplication(String templateId, String applicationId, String organizationId, String branchName, List pagesToImport) { - return getApplicationJsonFromTemplate(templateId).flatMap(applicationJson -> - importExportApplicationService.mergeApplicationJsonWithApplication( - organizationId, applicationId, null, applicationJson, pagesToImport + public Mono mergeTemplateWithApplication(String templateId, String applicationId, String organizationId, String branchName, List pagesToImport) { + return getApplicationJsonFromTemplate(templateId) + .flatMap(applicationJson -> importExportApplicationService.mergeApplicationJsonWithApplication( + organizationId, applicationId, null, applicationJson, pagesToImport) ) - ); + .flatMap(application -> importExportApplicationService.getApplicationImportDTO( + application.getId(), application.getWorkspaceId(), application) + ); } }