From 80bd11b44ecea451cd07fe98fd9d0237bf74d8c8 Mon Sep 17 00:00:00 2001 From: jendib Date: Tue, 15 Sep 2015 00:14:13 +0200 Subject: [PATCH] #23: Edit tag parent --- .../java/com/sismics/docs/rest/resource/TagResource.java | 8 ++++++-- docs-web/src/main/webapp/src/partial/docs/tag.html | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/TagResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/TagResource.java index 1ec03fd3..11883aab 100644 --- a/docs-web/src/main/java/com/sismics/docs/rest/resource/TagResource.java +++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/TagResource.java @@ -121,7 +121,9 @@ public class TagResource extends BaseResource { } // Check the parent - if (parentId != null) { + if (StringUtils.isEmpty(parentId)) { + parentId = null; + } else { Tag parentTag = tagDao.getByTagId(principal.getId(), parentId); if (parentTag == null) { throw new ClientException("ParentNotFound", MessageFormat.format("Parent not found: {0}", parentId)); @@ -175,7 +177,9 @@ public class TagResource extends BaseResource { } // Check the parent - if (parentId != null) { + if (StringUtils.isEmpty(parentId)) { + parentId = null; + } else { Tag parentTag = tagDao.getByTagId(principal.getId(), parentId); if (parentTag == null) { throw new ClientException("ParentNotFound", MessageFormat.format("Parent not found: {0}", parentId)); diff --git a/docs-web/src/main/webapp/src/partial/docs/tag.html b/docs-web/src/main/webapp/src/partial/docs/tag.html index c8f02165..37a9e7c9 100644 --- a/docs-web/src/main/webapp/src/partial/docs/tag.html +++ b/docs-web/src/main/webapp/src/partial/docs/tag.html @@ -21,6 +21,15 @@ + + +