mirror of
https://github.com/ash-project/ash.git
synced 2024-09-19 13:03:02 +12:00
fix: check changeset.action
before raising a required primary action error
This commit is contained in:
parent
44c0d09e30
commit
a97a65f6a6
2 changed files with 4 additions and 2 deletions
|
@ -2178,7 +2178,7 @@ defmodule Ash do
|
|||
|
||||
is_nil(changeset.__validated_for_action__) ->
|
||||
action =
|
||||
opts[:action] ||
|
||||
opts[:action] || changeset.action ||
|
||||
Ash.Resource.Info.primary_action!(changeset.resource, :create).name
|
||||
|
||||
Ash.Changeset.for_create(changeset, action, params, opts)
|
||||
|
|
|
@ -1756,6 +1756,8 @@ defmodule Ash.Changeset do
|
|||
raise_no_action(changeset.resource, action_or_name, changeset.action_type)
|
||||
end
|
||||
else
|
||||
action = get_action_entity(changeset.resource, action_or_name)
|
||||
|
||||
{changeset, _opts} =
|
||||
Ash.Actions.Helpers.set_context_and_get_opts(
|
||||
domain,
|
||||
|
@ -1763,7 +1765,7 @@ defmodule Ash.Changeset do
|
|||
opts
|
||||
)
|
||||
|
||||
changeset
|
||||
%{changeset | action: action}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue