mirror of
https://github.com/ash-project/ash_archival.git
synced 2024-09-19 13:02:55 +12:00
fix: properly pass actor into archive_related
This commit is contained in:
parent
55755caf65
commit
46cf71e53f
1 changed files with 1 additions and 2 deletions
|
@ -12,7 +12,6 @@ defmodule AshArchival.Resource.Changes.ArchiveRelated do
|
|||
Ash.Changeset.after_action(changeset, fn changeset, result ->
|
||||
# This is not optimized. We should do this with bulk queries, not resource actions.
|
||||
opts = context |> Ash.context_to_opts()
|
||||
{changeset.resource, context} |> IO.inspect()
|
||||
loaded = changeset.api.load!(result, archive_related, opts)
|
||||
|
||||
notifications =
|
||||
|
@ -27,7 +26,7 @@ defmodule AshArchival.Resource.Changes.ArchiveRelated do
|
|||
|> List.wrap()
|
||||
|> Enum.flat_map(fn related ->
|
||||
related
|
||||
|> Ash.Changeset.for_destroy(destroy_action, opts)
|
||||
|> Ash.Changeset.for_destroy(destroy_action, %{}, opts)
|
||||
|> (relationship.api || changeset.api).destroy!(
|
||||
opts
|
||||
|> Keyword.merge(return_notifications?: true)
|
||||
|
|
Loading…
Reference in a new issue