Update TagService.java

merge-requests/47/head
anastasia shulga 5 years ago
parent 1f36e04cd3
commit dbd61ce80c

@ -23,8 +23,16 @@ public class TagService {
return tags
.stream()
.map(tag -> {
return tag.getId() != null ? getExistById(tag) :
isExistByName(tag.getTagName()) != null ? isExistByName(tag.getTagName()) : create(tag);
if(tag.getId() != null){
return getExistById(tag);
}else {
Tag existTag = isExistByName(tag.getTagName());
if(existTag != null){
return existTag;
}else{
return create(tag);
}
}
}).collect(Collectors.toList());
}

Loading…
Cancel
Save