refactor: integrate approval ui review changes
This commit is contained in:
parent
28f97184b3
commit
f53a3ce3cc
13 changed files with 153 additions and 139 deletions
19
lib/membership/join_request/changes/helpers.ex
Normal file
19
lib/membership/join_request/changes/helpers.ex
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
defmodule Mv.Membership.JoinRequest.Changes.Helpers do
|
||||
@moduledoc """
|
||||
Shared helpers for JoinRequest change modules (e.g. ApproveRequest, RejectRequest).
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Extracts the actor's user id from the Ash change context.
|
||||
|
||||
Supports both atom and string keys for compatibility with different actor representations.
|
||||
"""
|
||||
@spec actor_id(term()) :: String.t() | nil
|
||||
def actor_id(nil), do: nil
|
||||
|
||||
def actor_id(actor) when is_map(actor) do
|
||||
Map.get(actor, :id) || Map.get(actor, "id")
|
||||
end
|
||||
|
||||
def actor_id(_), do: nil
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue