create folder for disable user repo
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { type UmbDisableUserRepository } from '../../repository/disable-user.repository.js';
|
||||
import { type UmbDisableUserRepository } from '../../repository/disable/disable-user.repository.js';
|
||||
import { UmbUserRepository } from '../../repository/user.repository.js';
|
||||
import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action';
|
||||
import { UmbContextConsumerController } from '@umbraco-cms/backoffice/context-api';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { UMB_USER_STORE_CONTEXT_TOKEN, UmbUserStore } from './user.store.js';
|
||||
import { UMB_USER_ITEM_STORE_CONTEXT_TOKEN, UmbUserItemStore } from './user-item.store.js';
|
||||
import { UmbUserDisableServerDataSource } from './sources/user-disable.server.data.js';
|
||||
import { UMB_USER_STORE_CONTEXT_TOKEN, UmbUserStore } from '../user.store.js';
|
||||
import { UMB_USER_ITEM_STORE_CONTEXT_TOKEN, UmbUserItemStore } from '../user-item.store.js';
|
||||
import { UmbDisableUserServerDataSource } from './disable-user.server.data.js';
|
||||
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbContextConsumerController } from '@umbraco-cms/backoffice/context-api';
|
||||
|
||||
@@ -8,13 +8,13 @@ export class UmbDisableUserRepository {
|
||||
#host: UmbControllerHostElement;
|
||||
#init;
|
||||
|
||||
#disableSource: UmbUserDisableServerDataSource;
|
||||
#disableSource: UmbDisableUserServerDataSource;
|
||||
#detailStore?: UmbUserStore;
|
||||
#itemStore?: UmbUserItemStore;
|
||||
|
||||
constructor(host: UmbControllerHostElement) {
|
||||
this.#host = host;
|
||||
this.#disableSource = new UmbUserDisableServerDataSource(this.#host);
|
||||
this.#disableSource = new UmbDisableUserServerDataSource(this.#host);
|
||||
|
||||
this.#init = Promise.all([
|
||||
new UmbContextConsumerController(this.#host, UMB_USER_STORE_CONTEXT_TOKEN, (instance) => {
|
||||
@@ -1,4 +1,4 @@
|
||||
import { UmbUserDisableDataSource } from '../../types.js';
|
||||
import { UmbDisableUserDataSource } from '../../types.js';
|
||||
import { UserResource } from '@umbraco-cms/backoffice/backend-api';
|
||||
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { tryExecuteAndNotify } from '@umbraco-cms/backoffice/resources';
|
||||
@@ -6,25 +6,25 @@ import { tryExecuteAndNotify } from '@umbraco-cms/backoffice/resources';
|
||||
/**
|
||||
* A data source for Data Type items that fetches data from the server
|
||||
* @export
|
||||
* @class UmbUserDisableServerDataSource
|
||||
* @class UmbDisableUserServerDataSource
|
||||
*/
|
||||
export class UmbUserDisableServerDataSource implements UmbUserDisableDataSource {
|
||||
export class UmbDisableUserServerDataSource implements UmbDisableUserDataSource {
|
||||
#host: UmbControllerHostElement;
|
||||
|
||||
/**
|
||||
* Creates an instance of UmbUserDisableServerDataSource.
|
||||
* Creates an instance of UmbDisableUserServerDataSource.
|
||||
* @param {UmbControllerHostElement} host
|
||||
* @memberof UmbUserDisableServerDataSource
|
||||
* @memberof UmbDisableUserServerDataSource
|
||||
*/
|
||||
constructor(host: UmbControllerHostElement) {
|
||||
this.#host = host;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set groups for users
|
||||
* @param {Array<string>} id
|
||||
* @return {*}
|
||||
* @memberof UmbUserDisableServerDataSource
|
||||
* Disables the specified user ids
|
||||
* @param {string[]} userIds
|
||||
* @returns {Promise<void>}
|
||||
* @memberof UmbDisableUserServerDataSource
|
||||
*/
|
||||
async disable(userIds: string[]) {
|
||||
if (!userIds) throw new Error('User ids are missing');
|
||||
@@ -35,7 +35,7 @@ export class UmbUserDisableServerDataSource implements UmbUserDisableDataSource
|
||||
requestBody: {
|
||||
userIds,
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { UmbUserEnableDataSource } from '../../types.js';
|
||||
import { UmbEnableUserDataSource } from '../../types.js';
|
||||
import { UserResource } from '@umbraco-cms/backoffice/backend-api';
|
||||
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { tryExecuteAndNotify } from '@umbraco-cms/backoffice/resources';
|
||||
@@ -8,7 +8,7 @@ import { tryExecuteAndNotify } from '@umbraco-cms/backoffice/resources';
|
||||
* @export
|
||||
* @class enable
|
||||
*/
|
||||
export class UmbEnableUserServerDataSource implements UmbUserEnableDataSource {
|
||||
export class UmbEnableUserServerDataSource implements UmbEnableUserDataSource {
|
||||
#host: UmbControllerHostElement;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { UmbUserRepository } from './user.repository.js';
|
||||
import { UmbUserItemStore } from './user-item.store.js';
|
||||
import { UmbUserStore } from './user.store.js';
|
||||
import { UmbDisableUserRepository } from './disable-user.repository.js';
|
||||
import { UmbDisableUserRepository } from './disable/disable-user.repository.js';
|
||||
import { UmbEnableUserRepository } from './enable/enable-user.repository.js';
|
||||
import type { ManifestStore, ManifestRepository, ManifestItemStore } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@ export interface UmbUserSetGroupDataSource {
|
||||
setGroups(userIds: string[], userGroupIds: string[]): Promise<UmbDataSourceErrorResponse>;
|
||||
}
|
||||
|
||||
export interface UmbUserDisableDataSource {
|
||||
export interface UmbDisableUserDataSource {
|
||||
disable(userIds: string[]): Promise<UmbDataSourceErrorResponse>;
|
||||
}
|
||||
export interface UmbUserEnableDataSource {
|
||||
export interface UmbEnableUserDataSource {
|
||||
enable(userIds: string[]): Promise<UmbDataSourceErrorResponse>;
|
||||
}
|
||||
export interface UmbUserUnlockDataSource {
|
||||
|
||||
Reference in New Issue
Block a user