refactor(base): fold /bases/inline-embed into /bases/create with parentPageId

The inline-embed endpoint was a thin wrapper around baseService.create:
its only differences from /bases/create were that it derived the
spaceId/workspaceId from a parent page, gated permission via
pageAccessService.validateCanEdit on that parent, and seeded inline
defaults (Title + Text 1 + Text 2 + one row). All of that fits
naturally on /bases/create as a parentPageId branch.

  - CreateBaseDto: spaceId is now optional. Either spaceId or
    parentPageId must be supplied; the controller validates the
    cross-field requirement and 400s otherwise.
  - /bases/create: with parentPageId, derive workspaceId/spaceId from
    the parent, validateCanEdit on the parent, apply inline defaults.
    Without parentPageId, gate on space-level Create, Page (the
    standalone path).
  - InlineEmbedBaseDto + createInlineEmbed deleted.
  - Slash command in the editor now POSTs /bases/create with
    { parentPageId } — the server picks up the inline branch.
This commit is contained in:
Philipinho
2026-04-28 20:29:07 +01:00
parent 0615bcf222
commit 5069573e8a
4 changed files with 43 additions and 41 deletions
@@ -529,7 +529,7 @@ const CommandGroups: SlashMenuGroupedItemsType = {
.run();
try {
const res = await api.post<{ id: string }>("/bases/inline-embed", {
const res = await api.post<{ id: string }>("/bases/create", {
parentPageId,
});