From cede027e0e72091a2928b110f3cce2952f2f16fa Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 8 Dec 2023 14:39:37 +0100 Subject: [PATCH] check for content --- .../workspace/stylesheet-workspace.context.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context.ts index 1636f9d69d..4337ab4f45 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context.ts @@ -112,13 +112,10 @@ export class UmbStylesheetWorkspaceContext } async sendContentGetRules() { - if (!this.getData()?.content) return; + const content = this.getData()?.content; + if (!content) throw Error('No content'); - const requestBody = { - content: this.getData()?.content, - }; - - const { data } = await this.repository.extractStylesheetRules(requestBody); + const { data } = await this.repository.extractStylesheetRules({ content }); this.setRules(data?.rules ?? []); }