fix: check changeset.valid? properly on destroys

This commit is contained in:
Zach Daniel 2023-01-30 13:23:35 -05:00
parent dbb9dd4c98
commit c9d63d2936

View file

@ -280,7 +280,11 @@ defmodule Ash.Actions.Destroy do
changeset
|> Ash.Changeset.put_context(:private, %{actor: actor, authorize?: authorize?})
|> Ash.Changeset.with_hooks(fn changeset ->
|> Ash.Changeset.with_hooks(fn
%{valid?: false} = changeset ->
{:error, changeset}
changeset ->
cond do
action.manual ->
{mod, opts} = action.manual