refactor: Replace actor option patterns with ash_actor_opts helper
- Replace if actor, do: [actor: actor], else: [] with Mv.Helpers.ash_actor_opts/1 - Update email_sync/loader.ex, member validations, member.ex, cycle_generator.ex - Consistent actor handling across non-LiveView modules
This commit is contained in:
parent
555ae15173
commit
897677a782
4 changed files with 27 additions and 6 deletions
|
|
@ -39,6 +39,7 @@ defmodule Mv.Membership.Member do
|
|||
|
||||
require Ash.Query
|
||||
import Ash.Expr
|
||||
alias Mv.Helpers
|
||||
require Logger
|
||||
|
||||
alias Mv.Membership.Helpers.VisibilityConfig
|
||||
|
|
@ -1217,7 +1218,7 @@ defmodule Mv.Membership.Member do
|
|||
# Extracts custom field values from existing member data (update scenario)
|
||||
defp extract_existing_values(member_data, changeset) do
|
||||
actor = Map.get(changeset.context, :actor)
|
||||
opts = if actor, do: [actor: actor], else: []
|
||||
opts = Helpers.ash_actor_opts(actor)
|
||||
|
||||
case Ash.load(member_data, :custom_field_values, opts) do
|
||||
{:ok, %{custom_field_values: existing_values}} ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue