From 461cc4b2e387b96deeb1fe294b4a7ddec6e37e8e Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 13 Sep 2023 15:44:56 +0200 Subject: [PATCH] clean up --- .../create/create-document-modal.element.ts | 9 ++++++--- .../documents/repository/sources/document.server.data.ts | 2 -- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/create-document-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/create-document-modal.element.ts index fd34740174..991f6aea1d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/create-document-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-actions/create/create-document-modal.element.ts @@ -21,11 +21,14 @@ export class UmbCreateDocumentModalElement extends UmbModalBaseElement< async firstUpdated() { const documentId = this.data?.id || null; - this.#retrieveAllowedChildrenOf(documentId); - this.#retrieveHeadline(documentId); + this.#retrieveAllowedDocumentTypesOf(documentId); + + if (documentId) { + this.#retrieveHeadline(documentId); + } } - async #retrieveAllowedChildrenOf(id: string | null) { + async #retrieveAllowedDocumentTypesOf(id: string | null) { const { data } = await this.#documentRepository.requestAllowedDocumentTypesOf(id); if (data) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/repository/sources/document.server.data.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/repository/sources/document.server.data.ts index a79dba84a4..6ee0c6c748 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/repository/sources/document.server.data.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/repository/sources/document.server.data.ts @@ -172,7 +172,6 @@ export class UmbDocumentServerDataSource /** * Get the allowed document types for root * @param {string} id - * @return {*} * @memberof UmbDocumentTypeServerDataSource */ async getAllowedDocumentTypesAtRoot() { @@ -183,7 +182,6 @@ export class UmbDocumentServerDataSource /** * Get the allowed document types for a given parent id * @param {string} id - * @return {*} * @memberof UmbDocumentTypeServerDataSource */ async getAllowedDocumentTypesOf(id: string) {