Tools → Newsletter saves drafts (migration 057: newsletters, with content blocks owned 'newsletter'), adds blocks written for the issue and an editable footer (no unsubscribe link: Mailchimp adds one), and turns a draft into an unpublished blog post. The admin engine binds child owner ids as text, so an auto-numbered record's blocks are owned by '1', not '1.0'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
820 B
JavaScript
27 lines
820 B
JavaScript
import { text, blocksChild } from "./columns.js";
|
|
|
|
/* ── Newsletter drafts (057_newsletters.sql) ─────────────────────
|
|
|
|
Saved from Tools → Newsletter (AdminNewsletter.tsx), which is
|
|
their only editor: there is no list or form for them in Data.
|
|
`picks` is the builder's JSON of what's ticked. Deleting a draft
|
|
takes its blocks with it (newsletters_cleanup). */
|
|
|
|
export const newsletters = {
|
|
key: "newsletters",
|
|
table: "newsletters",
|
|
idColumn: "id",
|
|
idKind: "auto",
|
|
concurrency: "updated_at",
|
|
|
|
list: {
|
|
columns: ["id", "title", "updated_at"],
|
|
filters: [],
|
|
search: ["title"],
|
|
order: "updated_at DESC, id DESC",
|
|
},
|
|
|
|
columns: [text("title"), text("intro"), text("footer"), text("picks")],
|
|
|
|
children: [blocksChild("newsletter")],
|
|
};
|