Skip to content

Switch API client to the new REST backend routes - #32

Merged
vadim9999 merged 1 commit into
masterfrom
feat/rest-api
Nov 11, 2026
Merged

vadim9999 merged 1 commit into
masterfrom
feat/rest-api

Conversation

@vadim9999

Copy link
Copy Markdown
Contributor

What & why

The backend was rewritten with REST routes and a unified error format (LLazyEmail/email-template-editor-nodejs#2). This updates the frontend API client to match.

Changes

  • src/api/main.ts: new paths (/tree, /tree/nodes/:key, /elements, /elements/:key), keys are URL-encoded; generate() reads { url } from the response. Function names and signatures are unchanged, so no component changes were needed.
  • src/api/main.types.ts: GenerateResponse replaces the unused Generate type.
  • e2e/editor.spec.ts: route mocks moved to /tree and /elements.
  • Docs (AGENTS.md, docs/AI_AGENT.md, docs/playwright.md, README.md, testing skill) describe the new API.

⚠️ Merge together with the backend

This client does not work with the old backend, and the old client does not work with the new one. Merge LLazyEmail/email-template-editor-nodejs#2 at the same time.

Testing

  • Vitest and next build pass
  • Every function in src/api/main.ts was run against the new backend on a copy of db.json: all 10 operations work, the generated HTML matches the old server byte for byte, and data round-trips unchanged
  • Playwright could not run locally (missing system libraries for Chromium); the e2e.yml workflow covers it in CI
  • tsc --noEmit reports errors in src/App.test.tsx that already exist on master and are unrelated to this change

- /tree, /tree/nodes/:key, /elements/:key with URL-encoded keys
- generate() reads { url } from the response
- Update e2e route mocks and docs

Requires LLazyEmail/email-template-editor-nodejs feat/enterprise-express.
@vadim9999
vadim9999 merged commit bf894b8 into master Nov 11, 2026
3 checks passed
@vadim9999
vadim9999 deleted the feat/rest-api branch November 11, 2026 13:12
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