Repository navigation
Switch API client to the new REST backend routes - #32
Merged
Merged
Conversation
- /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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:GenerateResponsereplaces the unusedGeneratetype.e2e/editor.spec.ts: route mocks moved to/treeand/elements.AGENTS.md,docs/AI_AGENT.md,docs/playwright.md,README.md, testing skill) describe the new API.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
next buildpasssrc/api/main.tswas run against the new backend on a copy ofdb.json: all 10 operations work, the generated HTML matches the old server byte for byte, and data round-trips unchangede2e.ymlworkflow covers it in CItsc --noEmitreports errors insrc/App.test.tsxthat already exist onmasterand are unrelated to this change