Skip to content

feat(api): return publicUrl and editorUrl on v1 form responses - #223

Merged
josue-commits merged 4 commits into
developfrom
feat/api-v1-form-urls
Oct 13, 2026
Merged

josue-commits merged 4 commits into
developfrom
feat/api-v1-form-urls

Conversation

@josue-commits

Copy link
Copy Markdown
Contributor

Summary

Every form returned by the v1 admin API now carries publicUrl (the link respondents open) and editorUrl (the builder link), so API clients and agents can share or open a form without rebuilding URLs themselves. Both are null when PUBLIC_APP_URL is not configured.

Changes

  • @quill/shared: the public form link rule moves into a shared form-links module (publicFormPath, formEditorPath), used by the API and already matching the web.
  • @quill/db: new read for one workspace's canonical public code, so links use the vanity slug once the workspace claims one.
  • apps/api: list, get, create, update, slug rename, duplicate and publish responses include both links; the list reads the account once.
  • The 409 STALE body returns current with both links too.
  • Changeset for @quill/shared and @quill/db.

How it was tested

  • pnpm test: 16/16 tasks pass (api 740, web 1208, db 348, shared 80).
  • The public link is checked against the same lookup the public page uses, after slug renames (PUT slug and legacy slug field), with a vanity slug, and with PUBLIC_APP_URL empty or unset.
  • Typecheck clean for api, shared, db, web; API lint 0 errors; publish-gate passed; pnpm changeset status OK.

Review notes

An independent review found that the 409 STALE current form was the only admin API form without the links. Fixed in c70d70b with a test that fails without the fix. Follow-ups left out of scope: per-route OpenAPI wording (#57) and switching the web to formEditorPath.

Coordination

Parallel API v1 PRs (#55, #57) may touch the same OpenAPI description lines and developer-docs.tsx; expect a small conflict there when merging in sequence.

🤖 Generated with Claude Code

josue-commits and others added 4 commits October 12, 2026 16:48
The web builds every form link with publicFormPath. The API is about to
hand the same link to agents, so the rule moves to @quill/shared (with an
editor path and a formLinks helper that joins both onto PUBLIC_APP_URL),
and the web module re-exports it instead of keeping its own copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Josue Hernandez <josue@daptatech.com>
getAccountPublicCode returns the vanity slug when claimed, else the short
code: the first segment of a form link, as the dashboard builds it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Josue Hernandez <josue@daptatech.com>
Create, get, list (each item), update, slug, duplicate and publish now
carry the form's public link and its builder link, built with the shared
publicFormPath on PUBLIC_APP_URL and the workspace's canonical code. Both
are null when PUBLIC_APP_URL is empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Josue Hernandez <josue@daptatech.com>
…STALE

A guarded PUT or publish that loses the optimistic lock answers 409 with the
form as it is now. That `current` was masked but had no links, so it was the
one form in the admin API without `publicUrl`/`editorUrl`. `unwrapGuarded`
now takes the controller's `formView` to shape it like every other response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Josue Hernandez <josue@daptatech.com>
@josue-commits
josue-commits merged commit 617294f into develop Oct 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant