PhoenixKitDocumentCreator.Attachments (PhoenixKitDocumentCreator v0.9.8)

Copy Markdown View Source

Scope folder for images uploaded from the template image picker:

config :phoenix_kit_document_creator, :attachments_parent_folder, {MyApp.Media, :parent_for}

called as parent_for(:document_image, actor_uuid, %{template_file_id: id}) (or /2), returning {:ok, folder_uuid} or nil (no scope, today's behaviour).

The answer is passed to core's media selector as scope_folder, which files uploads made from the selector under that folder; picking an existing file does not move it. Core 2.23.2 or later is required — an older core ignores the param. Core also drops an answer that is not a UUID of a live folder. A hook that raises, throws or exits is logged and treated as nil.

Summary

Functions

scope_folder(template_file_id, actor_uuid)

@spec scope_folder(String.t() | nil, String.t() | nil) :: String.t() | nil