PhoenixKitDocumentCreator.Web.Helpers (PhoenixKitDocumentCreator v0.2.10)

Copy Markdown View Source

Cross-LiveView helpers for the Document Creator admin pages.

Summary

Functions

Build the actor opts list to thread into context-fn calls.

Pull the acting user's UUID out of the LV scope, or nil when not signed in.

Functions

actor_opts(socket)

@spec actor_opts(Phoenix.LiveView.Socket.t()) :: keyword()

Build the actor opts list to thread into context-fn calls.

Returns [actor_uuid: uuid] when the LV's phoenix_kit_current_scope assign carries a user, otherwise []. Pass-through into mutating Documents.* functions for activity-log attribution.

actor_uuid(socket)

@spec actor_uuid(Phoenix.LiveView.Socket.t()) :: String.t() | nil

Pull the acting user's UUID out of the LV scope, or nil when not signed in.