mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: clean API method for reading a single notification
This commit is contained in:
@ -172,10 +172,7 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
if notifications.present?
|
||||
notification_ids = notifications.split(",").map(&:to_i)
|
||||
count = Notification.where(user_id: current_user.id, id: notification_ids, read: false).update_all(read: true)
|
||||
if count > 0
|
||||
current_user.publish_notifications_state
|
||||
end
|
||||
Notification.read(current_user, notification_ids)
|
||||
cookies.delete('cn')
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user