diff --git a/src/Umbraco.Web.UI.Client/libs/entity-action/action.ts b/src/Umbraco.Web.UI.Client/libs/entity-action/action.ts index 5c1ab79fd5..70c4a25985 100644 --- a/src/Umbraco.Web.UI.Client/libs/entity-action/action.ts +++ b/src/Umbraco.Web.UI.Client/libs/entity-action/action.ts @@ -2,7 +2,7 @@ import { UmbControllerHostInterface } from '@umbraco-cms/controller'; import { umbExtensionsRegistry, createExtensionClass } from '@umbraco-cms/extensions-api'; import { UmbObserverController } from '@umbraco-cms/observable-api'; -export interface UmbAction { +export interface UmbAction { host: UmbControllerHostInterface; repository: RepositoryType; execute(): Promise; diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/entity-bulk-action/entity-bulk-action.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/entity-bulk-action/entity-bulk-action.element.ts index 530ec2ab46..bc8ae75228 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/entity-bulk-action/entity-bulk-action.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/entity-bulk-action/entity-bulk-action.element.ts @@ -4,6 +4,7 @@ import { ifDefined } from 'lit-html/directives/if-defined.js'; import { UmbExecutedEvent } from '@umbraco-cms/events'; import { UmbLitElement } from '@umbraco-cms/element'; import { ManifestEntityBulkAction } from '@umbraco-cms/extensions-registry'; +import { UmbAction } from '@umbraco-cms/entity-action'; @customElement('umb-entity-bulk-action') class UmbEntityBulkActionElement extends UmbLitElement { @@ -40,9 +41,10 @@ class UmbEntityBulkActionElement extends UmbLitElement { this.#api = new this._manifest.meta.api(this, this._manifest.meta.repositoryAlias, this._selection); } - #api: any; + #api?: UmbAction; async #onClick(event: PointerEvent) { + if (!this.#api) return; event.stopPropagation(); await this.#api.execute(); this.dispatchEvent(new UmbExecutedEvent());