docs(cabana): document mltextarea field type

- forms.md: field-types row, ML section and example, lift paragraph,
  preset refusal
- admin-controllers.md and the cabana README name mltextarea
This commit is contained in:
Jakub Zych
2026-10-06 21:37:08 +02:00
parent a913eec50f
commit aa3a7c2e90
3 changed files with 12 additions and 7 deletions

View File

@@ -202,7 +202,7 @@ Every controller gets the same routes, relative to `<prefix>/api/v1/{vendor}/{pl
The cabana README lists the full route table, including relation, options, widget, toolbar and partial routes. Every response uses one JSON envelope (`cabana.Envelope`), and a validation failure is a 422 `validation_failed` error with messages per field.
Request parameters never reach SQL directly: search, sort and filters apply only to declared columns, and a write passes only the form's writable fields, filled through `lagoon.Fill` and validated through `lagoon.Validate` in a transaction. A `mltext` or `mlmarkdown` field arrives as a nested locale map: cabana lifts it before `cabana.ProjectWritableFields` drops nested values, writes the default locale as the host scalar, and calls a published `cabana.TranslationWriter` for the other locales inside the same permissioned save transaction. The show and save record payload then carries that nested map for every enabled locale (`hydrateMLRecord` via `TranslationWriter.TranslatedExact`; missing non-default codes stay empty). There is no separate translate-write or translate-read route; see [Markdown and multilingual fields](forms.md#markdown-and-multilingual-fields).
Request parameters never reach SQL directly: search, sort and filters apply only to declared columns, and a write passes only the form's writable fields, filled through `lagoon.Fill` and validated through `lagoon.Validate` in a transaction. An `mltext`, `mltextarea` or `mlmarkdown` field arrives as a nested locale map: cabana lifts it before `cabana.ProjectWritableFields` drops nested values, writes the default locale as the host scalar, and calls a published `cabana.TranslationWriter` for the other locales inside the same permissioned save transaction. The show and save record payload then carries that nested map for every enabled locale (`hydrateMLRecord` via `TranslationWriter.TranslatedExact`; missing non-default codes stay empty). There is no separate translate-write or translate-read route; see [Markdown and multilingual fields](forms.md#markdown-and-multilingual-fields).
## Hooks