Class: Silas::Inbox::InvocationsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Silas::Inbox::InvocationsController
- Defined in:
- app/controllers/silas/inbox/invocations_controller.rb
Overview
Approve/decline from the UI — the SAME code path as the Slack buttons and email links (invocation.approve!/decline!). Writes always require real auth, even when reads are public.
Instance Method Summary collapse
Instance Method Details
#approve ⇒ Object
10 11 12 13 14 15 |
# File 'app/controllers/silas/inbox/invocations_controller.rb', line 10 def approve @invocation.approve!(by: current_actor) respond_resolved rescue Silas::Error => e respond_error(e) end |
#decline ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/silas/inbox/invocations_controller.rb', line 17 def decline # decline-with-note: the textarea's reason becomes {denied: reason}, # which the model sees as the tool result. reason = params[:reason].presence || "declined from inbox" @invocation.decline!(reason: reason, by: current_actor) respond_resolved rescue Silas::Error => e respond_error(e) end |