diff --git a/app/controllers/cards/readings_controller.rb b/app/controllers/cards/readings_controller.rb index dbb379b15..bbc4d53c0 100644 --- a/app/controllers/cards/readings_controller.rb +++ b/app/controllers/cards/readings_controller.rb @@ -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 diff --git a/app/views/cards/readings/create.turbo_stream.erb b/app/views/cards/readings/create.turbo_stream.erb index 8f758752e..1f3b07b47 100644 --- a/app/views/cards/readings/create.turbo_stream.erb +++ b/app/views/cards/readings/create.turbo_stream.erb @@ -1,3 +1 @@ -<%= turbo_stream.update "notifications" do %> - <%= render collection: @notifications, partial: "notifications/notification" %> -<% end %> +<%= turbo_stream.remove @notification %>