fix: register path-style menu item routes and wrap menu item creation…#1078
Open
Rimander wants to merge 1 commit into
Open
fix: register path-style menu item routes and wrap menu item creation…#1078Rimander wants to merge 1 commit into
Rimander wants to merge 1 commit into
Conversation
… in a database transaction
|
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
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 does this PR do?
Follow-up to #1052 (menu REST API with camelCase responses):
MenuRepository.createItemrace fix. WhensortOrderis omitted, theSELECT max(sort_order)and the subsequentINSERTnow run in a singlewithTransaction. Two concurrent calls can no longer compute the same next index.MenuRepository.findManycleanup. Replaced the manual column-by-column re-spelling that fedrowToMenuwith a destructure-and-spread. Adding a column toMenuTableno longer requires updating this mapping in lockstep.resolveMenuintent. After thelength === 0/length > 1guards,matches[0]is replaced withconst [menu] = matchesso the non-null intent is obvious to readers used to the stricter basenoUncheckedIndexedAccess: truesetting.injectCoreRoutescoverage. Added a unit test intests/unit/astro/routes.test.tsthat assertsinjectCoreRoutesactually registers/_emdash/api/menus/[name]/items/[id]— closing the loop on the route-injection bug fix(api): menu REST API with camelCase responses #1052 fixed (the existing structural test only checked that the module exportsPUT/DELETE).No database schema, API surface, or response shape changes. Existing menu tests (
menu-repository.test.ts,menus-handlers.test.ts) continue to pass unchanged.Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runmessages.pochanges except in translation PRs — a workflow extracts catalogs on merge tomain.AI-generated code disclosure
Screenshots / test output