Skip to content

Commit

Permalink
improvement: support receiving the inputs when undoing generic actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Feb 17, 2025
1 parent 3829d68 commit 84c207c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/ash/reactor/steps/action_step.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,21 @@ defmodule Ash.Reactor.ActionStep do
|> maybe_set_kw(:tenant, arguments[:tenant])
|> Keyword.take(Ash.ActionInput.Opts.schema() |> Keyword.keys())
|> Keyword.drop([:resource])
|> Keyword.update(
:skip_unknown_inputs,
[:input_to_undo],
&[:input_to_undo | &1]
)

action_options =
[]
|> maybe_set_kw(:authorize?, options[:authorize?])
|> maybe_set_kw(:domain, options[:domain])

inputs =
arguments[:input]
%{}
|> Map.put(:result_to_undo, record)
|> Map.put(:input_to_undo, arguments[:input])

options[:resource]
|> ActionInput.for_action(options[:undo_action], inputs, action_input_options)
Expand Down

0 comments on commit 84c207c

Please sign in to comment.