Mark individual notifications as read

This commit is contained in:
Jason Zimdars
2025-02-21 16:39:50 -06:00
parent 03a204d9bf
commit 28bdc531b0
7 changed files with 84 additions and 31 deletions
@@ -6,4 +6,14 @@ 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