update repos
This commit is contained in:
@@ -1,22 +1,31 @@
|
||||
import type { UmbChangeUserPasswordRepository } from '../../repository/change-password/change-user-password.repository.js';
|
||||
import { UmbChangeUserPasswordRepository } from '../../repository/index.js';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action';
|
||||
import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action';
|
||||
import { UMB_MODAL_MANAGER_CONTEXT, UMB_CHANGE_PASSWORD_MODAL } from '@umbraco-cms/backoffice/modal';
|
||||
|
||||
export class UmbChangeUserPasswordEntityAction extends UmbEntityActionBase<UmbChangeUserPasswordRepository> {
|
||||
export class UmbChangeUserPasswordEntityAction extends UmbEntityActionBase<never> {
|
||||
constructor(host: UmbControllerHost, args: UmbEntityActionArgs<never>) {
|
||||
super(host, args);
|
||||
}
|
||||
|
||||
async execute() {
|
||||
if (!this.unique) throw new Error('Unique is not available');
|
||||
if (!this.repository) return;
|
||||
if (!this.args.unique) throw new Error('Unique is not available');
|
||||
|
||||
const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
|
||||
const modalContext = modalManager.open(this, UMB_CHANGE_PASSWORD_MODAL, {
|
||||
data: {
|
||||
user: {
|
||||
unique: this.unique,
|
||||
unique: this.args.unique,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const data = await modalContext.onSubmit();
|
||||
await this.repository?.changePassword(this.unique, data.newPassword);
|
||||
|
||||
const repository = new UmbChangeUserPasswordRepository(this);
|
||||
await repository.changePassword(this.args.unique, data.newPassword);
|
||||
}
|
||||
|
||||
destroy(): void {}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,29 @@
|
||||
import type { UmbEnableUserRepository } from '../../../repository/enable/enable-user.repository.js';
|
||||
import { UMB_RESEND_INVITE_TO_USER_MODAL } from '../../index.js';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action';
|
||||
import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action';
|
||||
import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
|
||||
|
||||
export class UmbResendInviteToUserEntityAction extends UmbEntityActionBase<UmbEnableUserRepository> {
|
||||
constructor(host: UmbControllerHost, args: UmbEntityActionArgs<never>) {
|
||||
super(host, args);
|
||||
}
|
||||
|
||||
async execute() {
|
||||
if (!this.unique) throw new Error('Unique is not available');
|
||||
if (!this.repository) return;
|
||||
if (!this.args.unique) throw new Error('Unique is not available');
|
||||
|
||||
const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
|
||||
const modalContext = modalManager.open(this, UMB_RESEND_INVITE_TO_USER_MODAL, {
|
||||
data: {
|
||||
user: {
|
||||
unique: this.unique,
|
||||
unique: this.args.unique,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await modalContext.onSubmit();
|
||||
}
|
||||
|
||||
destroy(): void {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user