#23: Edit tag parent

This commit is contained in:
jendib
2015-09-15 00:14:13 +02:00
parent 99a596b2e1
commit 80bd11b44e
2 changed files with 15 additions and 2 deletions
@@ -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));