Update delete.action.ts
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import type { UmbUserDetailRepository } from '../../repository/index.js';
|
||||
import { UmbUserDetailRepository } from '../../repository/index.js';
|
||||
import { html } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbEntityBulkActionBase } from '@umbraco-cms/backoffice/entity-bulk-action';
|
||||
import { umbConfirmModal } from '@umbraco-cms/backoffice/modal';
|
||||
|
||||
export class UmbUserDeleteEntityBulkAction extends UmbEntityBulkActionBase<UmbUserDetailRepository> {
|
||||
export class UmbUserDeleteEntityBulkAction extends UmbEntityBulkActionBase<never> {
|
||||
async execute() {
|
||||
if (this.selection.length === 0) return;
|
||||
|
||||
@@ -14,11 +14,15 @@ export class UmbUserDeleteEntityBulkAction extends UmbEntityBulkActionBase<UmbUs
|
||||
confirmLabel: 'Delete',
|
||||
});
|
||||
|
||||
const repository = new UmbUserDetailRepository(this._host);
|
||||
|
||||
//TODO: How should we handle bulk actions? right now we send a request per item we want to change.
|
||||
//TODO: For now we have to reload the page to see the update
|
||||
for (let index = 0; index < this.selection.length; index++) {
|
||||
const element = this.selection[index];
|
||||
await this.repository?.delete(element);
|
||||
await repository.delete(element);
|
||||
}
|
||||
}
|
||||
|
||||
destroy(): void {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user