Use one controller for all notification readings
This commit is contained in:
@@ -6,14 +6,4 @@ class NotificationsController < ApplicationController
|
||||
@unread = Current.user.notifications.unread.ordered
|
||||
end
|
||||
end
|
||||
|
||||
def mark_read
|
||||
@notification = Current.user.notifications.find(params[:id])
|
||||
@notification.update!(read_at: Time.current)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_back fallback_location: notifications_path }
|
||||
format.turbo_stream
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user