Skip to content

Commit

Permalink
fix: use skip_unknown_inputs to avoid unnecessary errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Apr 3, 2024
1 parent 566088f commit 187d96f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/transformers/define_action_workers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ defmodule AshOban.Transformers.DefineActionWorkers do
input,
authorize?: authorize?,
actor: actor,
domain: unquote(domain)
domain: unquote(domain),
skip_unknown_inputs: Map.keys(input)
)
|> Ash.run_action!()

Expand Down
6 changes: 4 additions & 2 deletions lib/transformers/define_schedulers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ defmodule AshOban.Transformers.DefineSchedulers do
|> Ash.Changeset.for_action(unquote(trigger.on_error), %{error: error},
authorize?: authorize?,
actor: actor,
domain: unquote(domain)
domain: unquote(domain),
skip_unknown_inputs: [:error]
)
|> AshOban.update_or_destroy()
|> case do
Expand Down Expand Up @@ -624,7 +625,8 @@ defmodule AshOban.Transformers.DefineSchedulers do
Map.merge(unquote(Macro.escape(trigger.action_input || %{})), args),
authorize?: authorize?,
actor: actor,
domain: unquote(domain)
domain: unquote(domain),
skip_unknown_input: [:metadata]
)
|> AshOban.update_or_destroy()
|> case do
Expand Down

0 comments on commit 187d96f

Please sign in to comment.