From 578266a41994566b516f2725fa306ee67cf5e54c Mon Sep 17 00:00:00 2001 From: navodzoysa Date: Mon, 5 Dec 2022 18:48:41 +0530 Subject: [PATCH] Fix error when deleting tags/categories with special characters --- .../ApplicationManagementPublisherAdminAPI.java | 14 +++++++------- ...ApplicationManagementPublisherAdminAPIImpl.java | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java index c3db07a21b..37554f6634 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java @@ -157,12 +157,12 @@ public interface ApplicationManagementPublisherAdminAPI { @PathParam("appId") int applicatioId); @DELETE - @Path("/tags/{tagName}") + @Path("/tags") @Produces(MediaType.APPLICATION_JSON) @ApiOperation( consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, - httpMethod = "GET", + httpMethod = "DELETE", value = "Delete application tag", notes = "This will delete application tag", tags = "Application Management", @@ -185,10 +185,10 @@ public interface ApplicationManagementPublisherAdminAPI { }) Response deleteTag( @ApiParam( - name = "tagName", + name = "tag-name", value = "Tag Name", required = true) - @PathParam("tagName") String tagName + @QueryParam("tag-name") String tagName ); @POST @@ -273,7 +273,7 @@ public interface ApplicationManagementPublisherAdminAPI { ); @DELETE - @Path("/categories/{categoryName}") + @Path("/categories") @Produces(MediaType.APPLICATION_JSON) @ApiOperation( consumes = MediaType.APPLICATION_JSON, @@ -301,10 +301,10 @@ public interface ApplicationManagementPublisherAdminAPI { }) Response deleteCategory( @ApiParam( - name = "categoryName", + name = "category-name", value = "Category Name", required = true) - @PathParam("categoryName") String categoryName + @QueryParam("category-name") String categoryName ); @PUT diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java index 9799ab9a7f..9dae875ca8 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java @@ -104,9 +104,9 @@ public class ApplicationManagementPublisherAdminAPIImpl implements ApplicationMa @DELETE @Override @Consumes(MediaType.WILDCARD) - @Path("/tags/{tagName}") + @Path("/tags") public Response deleteTag( - @PathParam("tagName") String tagName) { + @QueryParam("tag-name") String tagName) { ApplicationManager applicationManager = APIUtil.getApplicationManager(); try { applicationManager.deleteTag(tagName); @@ -169,9 +169,9 @@ public class ApplicationManagementPublisherAdminAPIImpl implements ApplicationMa @DELETE @Override @Consumes(MediaType.WILDCARD) - @Path("/categories/{categoryName}") + @Path("/categories") public Response deleteCategory( - @PathParam("categoryName") String categoryName) { + @QueryParam("category-name") String categoryName) { ApplicationManager applicationManager = APIUtil.getApplicationManager(); try { applicationManager.deleteCategory(categoryName);