Files
fizzy/app/controllers/cards/comments/reactions_controller.rb
T
Jorge Manrubia 2d96e7c9c6 Use streams to update/remove reactions
Prevents race condition causing flickering https://app.fizzy.do/5986089/cards/2906

This will prevent these from udpating live, but we will tackle that as part of live card
updates with page refreshes, which I will tackle soon.
2025-11-12 18:04:20 +01:00

26 lines
449 B
Ruby

class Cards::Comments::ReactionsController < ApplicationController
include CardScoped
before_action :set_comment
def index
end
def new
end
def create
@reaction = @comment.reactions.create!(params.expect(reaction: :content))
end
def destroy
@reaction = @comment.reactions.find(params[:id])
@reaction.destroy
end
private
def set_comment
@comment = @card.comments.find(params[:comment_id])
end
end