Card readings just need to remove the notification

No need to broadcast everything again
This commit is contained in:
David Heinemeier Hansson
2025-04-16 16:51:18 +02:00
parent 2757cd8e62
commit 6135909b7e
2 changed files with 3 additions and 5 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ class Cards::ReadingsController < ApplicationController
include CardScoped
def create
Current.user.notifications.unread.where(card: @card).read_all
@notifications = Current.user.notifications.unread.ordered.limit(20)
@notification = Current.user.notifications.find_by(card: @card)
@notification.read
end
end
@@ -1,3 +1 @@
<%= turbo_stream.update "notifications" do %>
<%= render collection: @notifications, partial: "notifications/notification" %>
<% end %>
<%= turbo_stream.remove @notification %>