refactor: Collapse the four stylesheet endpoints into one - #331
Open
rickbutterfield wants to merge 5 commits into
Open
refactor: Collapse the four stylesheet endpoints into one#331rickbutterfield wants to merge 5 commits into
rickbutterfield wants to merge 5 commits into
Conversation
…lural stylesheet routes to it
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…data source method Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…param Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
Stacked on #329 — this PR is rebased onto
v5/refactor/preview-pipeline-dedupso it only shows its own diff. Once #329 merges tov5/dev, GitHub will auto-retarget this PR tov5/dev.Collapses the four nearly-identical
Get{Grid,List,Rte,SingleBlock}Stylesheetscontroller actions (and their four frontend counterparts) onto one parameterized implementation.GET preview/stylesheets?blockType=action holds the real logic; the four existing plural routes become one-line forwarders to it. All four legacy routes are kept — this is additive only, not a breaking change, andIBlockPreviewService.GetStylesheetPaths's signature (a documented, overridable extension point) is completely untouched.blockTypeis validated ([BindRequired]+ an explicitEnum.IsDefinedcheck) so a missing or out-of-range value returns 400 instead of silently defaulting to Block Grid — a gap caught in whole-branch review, since this is a new public route on a NuGet-distributed package.BlockTypereaches the shared action, but thatnodeKey/documentTypeUniqueactually reach content resolution too.Test plan
dotnet test— 96/96 passing (backend branch's 91 + this PR's additions)npm test— 16/16 passing,tsc --noEmitclean🤖 Generated with Claude Code