aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server-jdbc')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java
index 90b70612..403dac09 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/TagServiceImpl.java
@@ -214,8 +214,11 @@ public class TagServiceImpl extends BaseJdbcService implements TagService {
newTags.stream().filter(t -> !currentTags.contains(t))
.forEach(t -> getJdbcTemplate().update("INSERT INTO messages_tags(message_id,tag_id) VALUES (?,?)", mid, t.TID));
- return getMessageTags(mid).stream()
+ List<Tag> result = getMessageTags(mid).stream()
.map(TagStats::getTag).collect(Collectors.toList());
+ jdbcTemplate.update("UPDATE messages_txt SET tags=? WHERE message_id=?", result.stream()
+ .map(Tag::getName).collect(Collectors.joining(" ")), mid);
+ return result;
}
@Override