Card readings just need to remove the notification
No need to broadcast everything again
This commit is contained in:
@@ -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 %>
|
||||
|
||||
Reference in New Issue
Block a user