improvement: thread context through when loading data

This commit is contained in:
Zach Daniel 2023-04-02 21:42:01 -04:00
parent 3a4b82a41e
commit e29ad1fcb1

View file

@ -3,9 +3,13 @@ defmodule Ash.Resource.Change.Load do
use Ash.Resource.Change use Ash.Resource.Change
alias Ash.Changeset alias Ash.Changeset
def change(changeset, opts, _) do def change(changeset, opts, context) do
Changeset.after_action(changeset, fn changeset, result -> Changeset.after_action(changeset, fn changeset, result ->
changeset.api.load(result, opts[:target]) changeset.api.load(result, opts[:target],
authorize?: context[:authorize?],
actor: context[:actor],
tracer: context[:tracer]
)
end) end)
end end
end end