mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: mark topics in sub categories as unread when dismissing parent
Previously we would only dismiss the parent category and leave the child categories unread
This commit is contained in:
@@ -68,12 +68,12 @@ class TopicsBulkAction
|
||||
end
|
||||
|
||||
def dismiss_posts
|
||||
sql = "
|
||||
UPDATE topic_users tu
|
||||
SET highest_seen_post_number = t.highest_post_number , last_read_post_number = highest_post_number
|
||||
FROM topics t
|
||||
WHERE t.id = tu.topic_id AND tu.user_id = :user_id AND t.id IN (:topic_ids)
|
||||
"
|
||||
sql = <<~SQL
|
||||
UPDATE topic_users tu
|
||||
SET highest_seen_post_number = t.highest_post_number , last_read_post_number = highest_post_number
|
||||
FROM topics t
|
||||
WHERE t.id = tu.topic_id AND tu.user_id = :user_id AND t.id IN (:topic_ids)
|
||||
SQL
|
||||
|
||||
DB.exec(sql, user_id: @user.id, topic_ids: @topic_ids)
|
||||
@changed_ids.concat @topic_ids
|
||||
|
||||
Reference in New Issue
Block a user