diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/user-repository-base.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/user-repository-base.ts index df97b934de..09c1fa9a7a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/user-repository-base.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/repository/user-repository-base.ts @@ -1,11 +1,10 @@ import { UMB_USER_STORE_CONTEXT_TOKEN, UmbUserStore } from './user.store.js'; import { UMB_USER_ITEM_STORE_CONTEXT_TOKEN, UmbUserItemStore } from './item/user-item.store.js'; import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api'; -import { UmbContextConsumerController } from '@umbraco-cms/backoffice/context-api'; import { UMB_NOTIFICATION_CONTEXT_TOKEN, UmbNotificationContext } from '@umbraco-cms/backoffice/notification'; +import { UmbRepositoryBase } from '@umbraco-cms/backoffice/repository'; -export class UmbUserRepositoryBase { - protected host; +export class UmbUserRepositoryBase extends UmbRepositoryBase { protected init; protected detailStore?: UmbUserStore; @@ -13,20 +12,20 @@ export class UmbUserRepositoryBase { protected notificationContext?: UmbNotificationContext; constructor(host: UmbControllerHostElement) { - this.host = host; + super(host); this.init = Promise.all([ - new UmbContextConsumerController(this.host, UMB_USER_STORE_CONTEXT_TOKEN, (instance) => { + this.consumeContext(UMB_USER_STORE_CONTEXT_TOKEN, (instance) => { this.detailStore = instance; }).asPromise(), - new UmbContextConsumerController(this.host, UMB_USER_ITEM_STORE_CONTEXT_TOKEN, (instance) => { + this.consumeContext(UMB_USER_ITEM_STORE_CONTEXT_TOKEN, (instance) => { this.itemStore = instance; }).asPromise(), - new UmbContextConsumerController(this.host, UMB_NOTIFICATION_CONTEXT_TOKEN, (instance) => { + this.consumeContext(UMB_NOTIFICATION_CONTEXT_TOKEN, (instance) => { this.notificationContext = instance; - }).asPromise(), + }).asPromise() ]); } }