PhoenixKitOG.Templates (PhoenixKitOG v0.1.0)

Copy Markdown View Source

Context for managing OpenGraph templates. CRUD only — the editor and renderer live elsewhere.

Mutating functions accept an opts keyword list; pass actor_uuid: user_uuid to attribute the change in the activity feed. Omitting it logs an anonymous entry — still auditable, just not attributed.

Summary

Functions

change(template, attrs \\ %{})

create(attrs, opts \\ [])

@spec create(
  map(),
  keyword()
) :: {:ok, PhoenixKitOG.Schemas.Template.t()} | {:error, Ecto.Changeset.t()}

delete(template, opts \\ [])

get(uuid)

@spec get(binary()) :: PhoenixKitOG.Schemas.Template.t() | nil

Returns nil when no template matches.

list()

@spec list() :: [PhoenixKitOG.Schemas.Template.t()]

Returns all templates, ordered by name.

update(template, attrs, opts \\ [])