|
|
|
@ -24,9 +24,10 @@ class NewDocumentHandler(
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
val tags = event.newTags
|
|
|
|
|
val newTagIds = event.newTags
|
|
|
|
|
.split(",")
|
|
|
|
|
.map { it.trim() }
|
|
|
|
|
.filter { it.isNotEmpty() }
|
|
|
|
|
.map { it to tagDao.findByName(it) }
|
|
|
|
|
.map { (name, tag) ->
|
|
|
|
|
if (tag == null) {
|
|
|
|
@ -35,8 +36,9 @@ class NewDocumentHandler(
|
|
|
|
|
tag
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.map { it.id }
|
|
|
|
|
|
|
|
|
|
val tagIdsToAttach = tags.map { it.id } + event.tagIds
|
|
|
|
|
val tagIdsToAttach = newTagIds + event.tagIds
|
|
|
|
|
tagIdsToAttach.forEach {
|
|
|
|
|
documentTaggingDao.save(
|
|
|
|
|
DocumentTagging.between(document, it)
|
|
|
|
|