From 8d3ed2ed885ea3ef5a305053bfa16d20f14fa50c Mon Sep 17 00:00:00 2001 From: Jayasanka Weerasinghe Date: Tue, 7 Jan 2020 12:27:42 +0530 Subject: [PATCH] Fix the user deletion issue in devicemgt react app --- .../device/mgt/jaxrs/service/api/UserManagementService.java | 2 ++ .../mgt/jaxrs/service/impl/UserManagementServiceImpl.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index 6000845829..d50f4cb50b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -372,8 +372,10 @@ public interface UserManagementService { @DELETE @Path("/{username}") + @Consumes(MediaType.WILDCARD) @ApiOperation( httpMethod = "DELETE", + consumes = MediaType.WILDCARD, value = "Deleting a User", notes = "When an employee leaves the organization, you can remove the user details from WSO2 IoTS using " + "this REST API.", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java index 52aeb46e40..251aa0eb64 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java @@ -183,7 +183,7 @@ public class UserManagementServiceImpl implements UserManagementService { DEFAULT_SUBSCRIBER + "' is missing in the system"); } } - + String[] roles = new String[tmpRoles.size()]; tmpRoles.toArray(roles); @@ -363,6 +363,7 @@ public class UserManagementServiceImpl implements UserManagementService { @DELETE @Path("/{username}") + @Consumes(MediaType.WILDCARD) @Override public Response removeUser(@PathParam("username") String username, @QueryParam("domain") String domain) { if (domain != null && !domain.isEmpty()) {