From cf8e23ff329892a2053b5f5f775f6ef796fd8383 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Tue, 23 Apr 2019 15:32:54 +0530 Subject: [PATCH] Fix get applications API response --- .../carbon/device/application/mgt/handler/util/HandlerUtil.java | 1 + .../api/services/impl/ApplicationManagementAPIImpl.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.handler/src/main/java/org/wso2/carbon/device/application/mgt/handler/util/HandlerUtil.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.handler/src/main/java/org/wso2/carbon/device/application/mgt/handler/util/HandlerUtil.java index 0f5c4d9d837..ac7786d88b1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.handler/src/main/java/org/wso2/carbon/device/application/mgt/handler/util/HandlerUtil.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.handler/src/main/java/org/wso2/carbon/device/application/mgt/handler/util/HandlerUtil.java @@ -95,6 +95,7 @@ public class HandlerUtil { } } proxyResponse.setCode(statusCode); + proxyResponse.setData(jsonString); proxyResponse .setExecutorResponse(HandlerConstants.EXECUTOR_EXCEPTION_PREFIX + getStatusKey(statusCode)); return proxyResponse; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementAPIImpl.java index e1a71cc6731..4c4e49a2b7d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementAPIImpl.java @@ -82,7 +82,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { try { ApplicationList applications = applicationManager.getApplications(filter); if (applications.getApplications().isEmpty()) { - return Response.status(Response.Status.NOT_FOUND) + return Response.status(Response.Status.OK) .entity("Couldn't find any application for the requested query.").build(); } return Response.status(Response.Status.OK).entity(applications).build();