Files
fizzy/app/controllers/cards/self_assignments_controller.rb
T
Mike Dalessio 2527f07365 Fix "M" hotkey using stale user from fragment cache
Add a SelfAssignmentsController to resolve the current user at request
time, avoiding the use of an incorrect user id baked into a cached URL.

ref: #2211 originally added the "M" hotkey
ref: https://app.fizzy.do/5986089/cards/3722
2026-01-16 13:41:33 -05:00

18 lines
472 B
Ruby

class Cards::SelfAssignmentsController < ApplicationController
include CardScoped
def create
if @card.toggle_assignment(Current.user)
respond_to do |format|
format.turbo_stream { render "cards/assignments/create" }
format.json { head :no_content }
end
else
respond_to do |format|
format.turbo_stream { render "cards/assignments/create" }
format.json { head :unprocessable_entity }
end
end
end
end