From a4f36810aba7341242841dd1a02a4bdd01befaa3 Mon Sep 17 00:00:00 2001 From: Rick Butterfield Date: Tue, 4 Aug 2026 21:17:23 +0100 Subject: [PATCH 1/5] refactor: add consolidated GetStylesheets action; delegate the four plural stylesheet routes to it --- .../Controllers/BlockPreviewApiController.cs | 71 +++++++--------- .../BlockPreviewApiControllerTests.cs | 80 ++++++++++++++++++- 2 files changed, 108 insertions(+), 43 deletions(-) diff --git a/src/Umbraco.Community.BlockPreview/Controllers/BlockPreviewApiController.cs b/src/Umbraco.Community.BlockPreview/Controllers/BlockPreviewApiController.cs index 57c8e41..72e1455 100644 --- a/src/Umbraco.Community.BlockPreview/Controllers/BlockPreviewApiController.cs +++ b/src/Umbraco.Community.BlockPreview/Controllers/BlockPreviewApiController.cs @@ -194,18 +194,10 @@ private async Task RunPreviewAsync( /// A list of stylesheet paths if configured; otherwise, an empty list. [HttpGet("preview/single/stylesheets")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IEnumerable))] - public async Task GetSingleBlockStylesheets( + public Task GetSingleBlockStylesheets( [FromQuery] Guid nodeKey = default, [FromQuery] Guid documentTypeUnique = default) - { - IPublishedContent? content = GetPublishedContent(nodeKey, documentTypeUnique); - - await _requestEnricher.EnrichAsync(HttpContext, content); - - var stylesheetPaths = await _blockPreviewService.GetStylesheetPaths(BlockType.SingleBlock, content!, ControllerContext); - - return Ok(stylesheetPaths); - } + => GetStylesheets(BlockType.SingleBlock, nodeKey, documentTypeUnique); /// /// Loads the in-memory settings from appsettings.json @@ -272,6 +264,29 @@ private static BlockTypeSettings ApplyIgnoredContentTypes(BlockTypeSettings orig } + /// + /// Retrieves the stylesheet paths for a block preview of the given type. + /// + /// The block editor type. + /// The key of the node. + /// The unique identifier for the document type. + /// A list of stylesheet paths if configured; otherwise, an empty list. + [HttpGet("preview/stylesheets")] + [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IEnumerable))] + public async Task GetStylesheets( + [FromQuery] BlockType blockType, + [FromQuery] Guid nodeKey = default, + [FromQuery] Guid documentTypeUnique = default) + { + IPublishedContent? content = GetPublishedContent(nodeKey, documentTypeUnique); + + await _requestEnricher.EnrichAsync(HttpContext, content); + + var stylesheetPaths = await _blockPreviewService.GetStylesheetPaths(blockType, content!, ControllerContext); + + return Ok(stylesheetPaths); + } + /// /// Retrieves the stylesheet path for a grid block preview. /// @@ -308,18 +323,10 @@ public async Task GetGridStylesheet( /// A list of stylesheet paths if configured; otherwise, a 404 response. [HttpGet("preview/grid/stylesheets")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IEnumerable))] - public async Task GetGridStylesheets( + public Task GetGridStylesheets( [FromQuery] Guid nodeKey = default, [FromQuery] Guid documentTypeUnique = default) - { - IPublishedContent? content = GetPublishedContent(nodeKey, documentTypeUnique); - - await _requestEnricher.EnrichAsync(HttpContext, content); - - var stylesheetPaths = await _blockPreviewService.GetStylesheetPaths(BlockType.BlockGrid, content!, ControllerContext); - - return Ok(stylesheetPaths); - } + => GetStylesheets(BlockType.BlockGrid, nodeKey, documentTypeUnique); /// /// Retrieves the stylesheet path for a list block preview. @@ -357,18 +364,10 @@ public async Task GetListStylesheet( /// A list of stylesheet paths if configured; otherwise, a 404 response. [HttpGet("preview/list/stylesheets")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IEnumerable))] - public async Task GetListStylesheets( + public Task GetListStylesheets( [FromQuery] Guid nodeKey = default, [FromQuery] Guid documentTypeUnique = default) - { - IPublishedContent? content = GetPublishedContent(nodeKey, documentTypeUnique); - - await _requestEnricher.EnrichAsync(HttpContext, content); - - var stylesheetPaths = await _blockPreviewService.GetStylesheetPaths(BlockType.BlockList, content!, ControllerContext); - - return Ok(stylesheetPaths); - } + => GetStylesheets(BlockType.BlockList, nodeKey, documentTypeUnique); /// /// Retrieves the stylesheet path for a rich text block preview. @@ -406,18 +405,10 @@ public async Task GetRteStylesheet( /// A list of stylesheet paths if configured; otherwise, a 404 response. [HttpGet("preview/rte/stylesheets")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IEnumerable))] - public async Task GetRteStylesheets( + public Task GetRteStylesheets( [FromQuery] Guid nodeKey = default, [FromQuery] Guid documentTypeUnique = default) - { - IPublishedContent? content = GetPublishedContent(nodeKey, documentTypeUnique); - - await _requestEnricher.EnrichAsync(HttpContext, content); - - var stylesheetPaths = await _blockPreviewService.GetStylesheetPaths(BlockType.RichText, content!, ControllerContext); - - return Ok(stylesheetPaths); - } + => GetStylesheets(BlockType.RichText, nodeKey, documentTypeUnique); #endregion #region Private diff --git a/tests/Umbraco.Community.BlockPreview.Tests/Controllers/BlockPreviewApiControllerTests.cs b/tests/Umbraco.Community.BlockPreview.Tests/Controllers/BlockPreviewApiControllerTests.cs index 7544436..d257af8 100644 --- a/tests/Umbraco.Community.BlockPreview.Tests/Controllers/BlockPreviewApiControllerTests.cs +++ b/tests/Umbraco.Community.BlockPreview.Tests/Controllers/BlockPreviewApiControllerTests.cs @@ -171,14 +171,27 @@ public async Task PreviewRichTextMarkup_PassesRenderDelegateThatCallsRenderRichT } [Test] - public async Task GetGridStylesheets_ResolvesContentViaContentResolverThenAsksBlockPreviewService() + public async Task GetStylesheets_ForBlockGrid_ReturnsPathsFromBlockPreviewService() + { + _blockPreviewService + .Setup(s => s.GetStylesheetPaths(BlockType.BlockGrid, It.IsAny(), It.IsAny())) + .ReturnsAsync(new List { "/css/grid.css" }); + + var result = await _controller.GetStylesheets(BlockType.BlockGrid, Guid.NewGuid(), Guid.NewGuid()); + + var ok = result as OkObjectResult; + Assert.That(ok, Is.Not.Null); + Assert.That(ok!.Value, Is.EqualTo(new List { "/css/grid.css" })); + } + + [Test] + public async Task GetGridStylesheets_DelegatesToGetStylesheetsWithBlockGrid() { var nodeKey = Guid.NewGuid(); var docType = Guid.NewGuid(); var content = Mock.Of(); // IPreviewContentResolver.Resolve's 3rd parameter is `out bool isActualContent`, not an - // out IPublishedContent — the resolved content comes back via the return value instead - // (matches Task 3's PreviewRequestExecutorTests.cs usage of the same interface). + // out IPublishedContent — the resolved content comes back via the return value instead. bool isActualContent = true; _contentResolver.Setup(r => r.Resolve(nodeKey, docType, out isActualContent)).Returns(content); _blockPreviewService @@ -191,5 +204,66 @@ public async Task GetGridStylesheets_ResolvesContentViaContentResolverThenAsksBl Assert.That(ok, Is.Not.Null); Assert.That(ok!.Value, Is.EqualTo(new List { "/css/grid.css" })); _contentResolver.Verify(r => r.Resolve(nodeKey, docType, out isActualContent), Times.Once); + _blockPreviewService.Verify(s => s.GetStylesheetPaths(BlockType.BlockGrid, content, It.IsAny()), Times.Once); + } + + [Test] + public async Task GetListStylesheets_DelegatesToGetStylesheetsWithBlockList() + { + var nodeKey = Guid.NewGuid(); + var docType = Guid.NewGuid(); + var content = Mock.Of(); + bool isActualContent = true; + _contentResolver.Setup(r => r.Resolve(nodeKey, docType, out isActualContent)).Returns(content); + _blockPreviewService + .Setup(s => s.GetStylesheetPaths(BlockType.BlockList, content, It.IsAny())) + .ReturnsAsync(new List { "/css/list.css" }); + + var result = await _controller.GetListStylesheets(nodeKey, docType); + + var ok = result as OkObjectResult; + Assert.That(ok!.Value, Is.EqualTo(new List { "/css/list.css" })); + _contentResolver.Verify(r => r.Resolve(nodeKey, docType, out isActualContent), Times.Once); + _blockPreviewService.Verify(s => s.GetStylesheetPaths(BlockType.BlockList, content, It.IsAny()), Times.Once); + } + + [Test] + public async Task GetRteStylesheets_DelegatesToGetStylesheetsWithRichText() + { + var nodeKey = Guid.NewGuid(); + var docType = Guid.NewGuid(); + var content = Mock.Of(); + bool isActualContent = true; + _contentResolver.Setup(r => r.Resolve(nodeKey, docType, out isActualContent)).Returns(content); + _blockPreviewService + .Setup(s => s.GetStylesheetPaths(BlockType.RichText, content, It.IsAny())) + .ReturnsAsync(new List { "/css/rte.css" }); + + var result = await _controller.GetRteStylesheets(nodeKey, docType); + + var ok = result as OkObjectResult; + Assert.That(ok!.Value, Is.EqualTo(new List { "/css/rte.css" })); + _contentResolver.Verify(r => r.Resolve(nodeKey, docType, out isActualContent), Times.Once); + _blockPreviewService.Verify(s => s.GetStylesheetPaths(BlockType.RichText, content, It.IsAny()), Times.Once); + } + + [Test] + public async Task GetSingleBlockStylesheets_DelegatesToGetStylesheetsWithSingleBlock() + { + var nodeKey = Guid.NewGuid(); + var docType = Guid.NewGuid(); + var content = Mock.Of(); + bool isActualContent = true; + _contentResolver.Setup(r => r.Resolve(nodeKey, docType, out isActualContent)).Returns(content); + _blockPreviewService + .Setup(s => s.GetStylesheetPaths(BlockType.SingleBlock, content, It.IsAny())) + .ReturnsAsync(new List { "/css/single.css" }); + + var result = await _controller.GetSingleBlockStylesheets(nodeKey, docType); + + var ok = result as OkObjectResult; + Assert.That(ok!.Value, Is.EqualTo(new List { "/css/single.css" })); + _contentResolver.Verify(r => r.Resolve(nodeKey, docType, out isActualContent), Times.Once); + _blockPreviewService.Verify(s => s.GetStylesheetPaths(BlockType.SingleBlock, content, It.IsAny()), Times.Once); } } From fb790cbd26cd52ae09d9cda4601dcd1421f90318 Mon Sep 17 00:00:00 2001 From: Rick Butterfield Date: Tue, 4 Aug 2026 23:19:42 +0100 Subject: [PATCH 2/5] chore: regenerate OpenAPI client for the new GetStylesheets endpoint Co-Authored-By: Claude Sonnet 5 --- .../src/api/index.ts | 2 +- .../src/api/sdk.gen.ts | 9 ++++++- .../src/api/types.gen.ts | 27 +++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Community.BlockPreview.UI/src/api/index.ts b/src/Umbraco.Community.BlockPreview.UI/src/api/index.ts index 3731393..fcc8d64 100644 --- a/src/Umbraco.Community.BlockPreview.UI/src/api/index.ts +++ b/src/Umbraco.Community.BlockPreview.UI/src/api/index.ts @@ -1,5 +1,5 @@ // This file is auto-generated by @hey-api/openapi-ts -export type * from './types.gen'; +export * from './types.gen'; export * from './client.gen'; export * from './sdk.gen'; diff --git a/src/Umbraco.Community.BlockPreview.UI/src/api/sdk.gen.ts b/src/Umbraco.Community.BlockPreview.UI/src/api/sdk.gen.ts index 5b3cc0c..7e5f7ad 100644 --- a/src/Umbraco.Community.BlockPreview.UI/src/api/sdk.gen.ts +++ b/src/Umbraco.Community.BlockPreview.UI/src/api/sdk.gen.ts @@ -2,7 +2,7 @@ import type { Client, Options as Options2, TDataShape } from './client'; import { client } from './client.gen'; -import type { GetGridStylesheetData, GetGridStylesheetResponses, GetGridStylesheetsData, GetGridStylesheetsResponses, GetListStylesheetData, GetListStylesheetResponses, GetListStylesheetsData, GetListStylesheetsResponses, GetRteStylesheetData, GetRteStylesheetResponses, GetRteStylesheetsData, GetRteStylesheetsResponses, GetSettingsData, GetSettingsResponses, GetSingleBlockStylesheetsData, GetSingleBlockStylesheetsResponses, PreviewGridBlockData, PreviewGridBlockResponses, PreviewListBlockData, PreviewListBlockResponses, PreviewRichTextMarkupData, PreviewRichTextMarkupResponses, PreviewSingleBlockData, PreviewSingleBlockResponses } from './types.gen'; +import type { GetGridStylesheetData, GetGridStylesheetResponses, GetGridStylesheetsData, GetGridStylesheetsResponses, GetListStylesheetData, GetListStylesheetResponses, GetListStylesheetsData, GetListStylesheetsResponses, GetRteStylesheetData, GetRteStylesheetResponses, GetRteStylesheetsData, GetRteStylesheetsResponses, GetSettingsData, GetSettingsResponses, GetSingleBlockStylesheetsData, GetSingleBlockStylesheetsResponses, GetStylesheetsData, GetStylesheetsResponses, PreviewGridBlockData, PreviewGridBlockResponses, PreviewListBlockData, PreviewListBlockResponses, PreviewRichTextMarkupData, PreviewRichTextMarkupResponses, PreviewSingleBlockData, PreviewSingleBlockResponses } from './types.gen'; export type Options = Options2 & { /** @@ -121,6 +121,13 @@ export class BlockPreviewService { }); } + public static getStylesheets(options?: Options) { + return (options?.client ?? client).get({ + url: '/umbraco/block-preview/api/v1/preview/stylesheets', + ...options + }); + } + public static getSettings(options?: Options) { return (options?.client ?? client).get({ url: '/umbraco/block-preview/api/v1/settings', diff --git a/src/Umbraco.Community.BlockPreview.UI/src/api/types.gen.ts b/src/Umbraco.Community.BlockPreview.UI/src/api/types.gen.ts index 0dc07a7..559d6cc 100644 --- a/src/Umbraco.Community.BlockPreview.UI/src/api/types.gen.ts +++ b/src/Umbraco.Community.BlockPreview.UI/src/api/types.gen.ts @@ -11,6 +11,13 @@ export type BlockPreviewOptions = { singleBlock: BlockTypeSettings; }; +export enum BlockType { + BLOCK_GRID = 'BlockGrid', + BLOCK_LIST = 'BlockList', + RICH_TEXT = 'RichText', + SINGLE_BLOCK = 'SingleBlock' +} + export type BlockTypeSettings = { enabled: boolean; viewLocations?: Array | null; @@ -253,6 +260,26 @@ export type GetSingleBlockStylesheetsResponses = { export type GetSingleBlockStylesheetsResponse = GetSingleBlockStylesheetsResponses[keyof GetSingleBlockStylesheetsResponses]; +export type GetStylesheetsData = { + body?: never; + path?: never; + query?: { + blockType?: BlockType; + nodeKey?: string; + documentTypeUnique?: string; + }; + url: '/umbraco/block-preview/api/v1/preview/stylesheets'; +}; + +export type GetStylesheetsResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetStylesheetsResponse = GetStylesheetsResponses[keyof GetStylesheetsResponses]; + export type GetSettingsData = { body?: never; path?: never; From 9b364f721b24221680344abe85d7f195c8e52df0 Mon Sep 17 00:00:00 2001 From: Rick Butterfield Date: Wed, 5 Aug 2026 07:39:21 +0100 Subject: [PATCH 3/5] refactor: switch preview elements to the consolidated getStylesheets data source method Co-Authored-By: Claude Sonnet 5 --- .../blockEditor/block-grid-preview.custom-view.element.ts | 3 ++- .../blockEditor/block-list-preview.custom-view.element.ts | 3 ++- .../block-single-preview.custom-view.element.ts | 3 ++- .../blockEditor/rich-text-preview.custom-view.element.ts | 3 ++- .../src/repository/preview.data-source.ts | 7 ++++++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-grid-preview.custom-view.element.ts b/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-grid-preview.custom-view.element.ts index 313256e..04f49d1 100644 --- a/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-grid-preview.custom-view.element.ts +++ b/src/Umbraco.Community.BlockPreview.UI/src/blockEditor/block-grid-preview.custom-view.element.ts @@ -1,6 +1,7 @@ import { BlockPreviewBaseElement } from './block-preview-base.element'; import { BlockGridContext } from './types'; import { PreviewDataSource } from '../repository'; +import { BlockType } from '../api'; import { css, customElement, property } from "@umbraco-cms/backoffice/external/lit"; import { UMB_BLOCK_GRID_ENTRY_CONTEXT, UMB_BLOCK_GRID_MANAGER_CONTEXT, UmbBlockGridLayoutModel, UmbBlockGridValueModel, UmbBlockGridLayoutAreaItemModel } from "@umbraco-cms/backoffice/block-grid"; import { UMB_CONTENT_WORKSPACE_CONTEXT } from "@umbraco-cms/backoffice/content"; @@ -230,7 +231,7 @@ export class BlockGridPreviewCustomView extends BlockPreviewBaseElement>; getSingleBlockStylesheets(query: StylesheetQuery): Promise>; getRteStylesheets(query: StylesheetQuery): Promise>; + getStylesheets(blockType: BlockType, query: StylesheetQuery): Promise>; } export class PreviewDataSource implements IPreviewDataSource { @@ -77,4 +78,8 @@ export class PreviewDataSource implements IPreviewDataSource { async getRteStylesheets(query: StylesheetQuery): Promise> { return await tryExecute(this.#host, BlockPreviewService.getRteStylesheets({ query })); } + + async getStylesheets(blockType: BlockType, query: StylesheetQuery): Promise> { + return await tryExecute(this.#host, BlockPreviewService.getStylesheets({ query: { blockType, ...query } })); + } } From d02d2012f5b18fe90e6a278b9d3fdca4a7bc0b6b Mon Sep 17 00:00:00 2001 From: Rick Butterfield Date: Wed, 5 Aug 2026 07:59:19 +0100 Subject: [PATCH 4/5] fix: Validate blockType and strengthen delegation test coverage Co-Authored-By: Claude Sonnet 5 --- .../src/repository/preview.data-source.ts | 2 +- .../Controllers/BlockPreviewApiController.cs | 8 +++++++- .../Controllers/BlockPreviewApiControllerTests.cs | 11 +++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Community.BlockPreview.UI/src/repository/preview.data-source.ts b/src/Umbraco.Community.BlockPreview.UI/src/repository/preview.data-source.ts index 5c28ff6..4c15a7c 100644 --- a/src/Umbraco.Community.BlockPreview.UI/src/repository/preview.data-source.ts +++ b/src/Umbraco.Community.BlockPreview.UI/src/repository/preview.data-source.ts @@ -80,6 +80,6 @@ export class PreviewDataSource implements IPreviewDataSource { } async getStylesheets(blockType: BlockType, query: StylesheetQuery): Promise> { - return await tryExecute(this.#host, BlockPreviewService.getStylesheets({ query: { blockType, ...query } })); + return await tryExecute(this.#host, BlockPreviewService.getStylesheets({ query: { ...query, blockType } })); } } diff --git a/src/Umbraco.Community.BlockPreview/Controllers/BlockPreviewApiController.cs b/src/Umbraco.Community.BlockPreview/Controllers/BlockPreviewApiController.cs index 72e1455..fa6eb0e 100644 --- a/src/Umbraco.Community.BlockPreview/Controllers/BlockPreviewApiController.cs +++ b/src/Umbraco.Community.BlockPreview/Controllers/BlockPreviewApiController.cs @@ -1,6 +1,7 @@ using Asp.Versioning; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Cache; @@ -274,10 +275,15 @@ private static BlockTypeSettings ApplyIgnoredContentTypes(BlockTypeSettings orig [HttpGet("preview/stylesheets")] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IEnumerable))] public async Task GetStylesheets( - [FromQuery] BlockType blockType, + [FromQuery][BindRequired] BlockType blockType, [FromQuery] Guid nodeKey = default, [FromQuery] Guid documentTypeUnique = default) { + if (!Enum.IsDefined(typeof(BlockType), blockType)) + { + return BadRequest("Invalid blockType."); + } + IPublishedContent? content = GetPublishedContent(nodeKey, documentTypeUnique); await _requestEnricher.EnrichAsync(HttpContext, content); diff --git a/tests/Umbraco.Community.BlockPreview.Tests/Controllers/BlockPreviewApiControllerTests.cs b/tests/Umbraco.Community.BlockPreview.Tests/Controllers/BlockPreviewApiControllerTests.cs index d257af8..48c755b 100644 --- a/tests/Umbraco.Community.BlockPreview.Tests/Controllers/BlockPreviewApiControllerTests.cs +++ b/tests/Umbraco.Community.BlockPreview.Tests/Controllers/BlockPreviewApiControllerTests.cs @@ -184,6 +184,17 @@ public async Task GetStylesheets_ForBlockGrid_ReturnsPathsFromBlockPreviewServic Assert.That(ok!.Value, Is.EqualTo(new List { "/css/grid.css" })); } + [Test] + public async Task GetStylesheets_WithUndefinedBlockType_ReturnsBadRequest() + { + var result = await _controller.GetStylesheets((BlockType)99, Guid.NewGuid(), Guid.NewGuid()); + + Assert.That(result, Is.InstanceOf()); + _blockPreviewService.Verify( + s => s.GetStylesheetPaths(It.IsAny(), It.IsAny(), It.IsAny()), + Times.Never); + } + [Test] public async Task GetGridStylesheets_DelegatesToGetStylesheetsWithBlockGrid() { From b9fa4174c277ac7f48fe85d99515b5f2837c787c Mon Sep 17 00:00:00 2001 From: Rick Butterfield Date: Wed, 5 Aug 2026 08:00:33 +0100 Subject: [PATCH 5/5] =?UTF-8?q?chore:=20regenerate=20OpenAPI=20client=20?= =?UTF-8?q?=E2=80=94=20blockType=20is=20now=20a=20required=20query=20param?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5 --- src/Umbraco.Community.BlockPreview.UI/src/api/sdk.gen.ts | 4 ++-- src/Umbraco.Community.BlockPreview.UI/src/api/types.gen.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Community.BlockPreview.UI/src/api/sdk.gen.ts b/src/Umbraco.Community.BlockPreview.UI/src/api/sdk.gen.ts index 7e5f7ad..889e3e6 100644 --- a/src/Umbraco.Community.BlockPreview.UI/src/api/sdk.gen.ts +++ b/src/Umbraco.Community.BlockPreview.UI/src/api/sdk.gen.ts @@ -121,8 +121,8 @@ export class BlockPreviewService { }); } - public static getStylesheets(options?: Options) { - return (options?.client ?? client).get({ + public static getStylesheets(options: Options) { + return (options.client ?? client).get({ url: '/umbraco/block-preview/api/v1/preview/stylesheets', ...options }); diff --git a/src/Umbraco.Community.BlockPreview.UI/src/api/types.gen.ts b/src/Umbraco.Community.BlockPreview.UI/src/api/types.gen.ts index 559d6cc..8aa12c4 100644 --- a/src/Umbraco.Community.BlockPreview.UI/src/api/types.gen.ts +++ b/src/Umbraco.Community.BlockPreview.UI/src/api/types.gen.ts @@ -263,8 +263,8 @@ export type GetSingleBlockStylesheetsResponse = GetSingleBlockStylesheetsRespons export type GetStylesheetsData = { body?: never; path?: never; - query?: { - blockType?: BlockType; + query: { + blockType: BlockType; nodeKey?: string; documentTypeUnique?: string; };