diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionCollectionServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionCollectionServiceImpl.java index afb610cfaa..e319bbd5af 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionCollectionServiceImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ActionCollectionServiceImpl.java @@ -1,23 +1,15 @@ package com.appsmith.server.services; -import com.appsmith.external.models.ActionConfiguration; -import com.appsmith.external.models.DatasourceConfiguration; -import com.appsmith.external.models.Property; import com.appsmith.server.domains.Action; import com.appsmith.server.domains.Collection; -import com.appsmith.server.domains.Datasource; import com.appsmith.server.exceptions.AppsmithError; import com.appsmith.server.exceptions.AppsmithException; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpMethod; import org.springframework.stereotype.Service; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import java.util.ArrayList; -import java.util.List; - @Service @Slf4j public class ActionCollectionServiceImpl implements ActionCollectionService { @@ -83,10 +75,6 @@ public class ActionCollectionServiceImpl implements ActionCollectionService { */ @Override public Mono createAction(Action action) { - if (action.getTemplateId() != null) { - return createMockDataAction(action); - } - if (action.getCollectionId() == null) { return actionService.create(action); } @@ -97,28 +85,6 @@ public class ActionCollectionServiceImpl implements ActionCollectionService { .flatMap(savedAction -> collectionService.addSingleActionToCollection(finalAction.getCollectionId(), savedAction)); } - private Mono createMockDataAction(Action action) { - action.setName("ResultActionAPI"); - Datasource datasource = new Datasource(); - DatasourceConfiguration datasourceConfiguration = new DatasourceConfiguration(); - datasourceConfiguration.setUrl("http://google.com"); - datasource.setDatasourceConfiguration(datasourceConfiguration); - - ActionConfiguration actionConfiguration = new ActionConfiguration(); - actionConfiguration.setPath("/viewSomething"); - actionConfiguration.setHttpMethod(HttpMethod.GET); - List headers = new ArrayList<>(); - Property header = new Property(); - header.setKey("key"); - header.setValue("value"); - headers.add(header); - actionConfiguration.setHeaders(headers); - - action.setActionConfiguration(actionConfiguration); - action.setDatasource(datasource); - return Mono.just(action); - } - @Override public Mono updateAction(String id, Action action) { //The change was not in CollectionId, just go ahead and update normally