24 lines
911 B
TypeScript
24 lines
911 B
TypeScript
import { EntityManager } from "@mikro-orm/postgresql";
|
|
import { Injectable, Logger } from "@nestjs/common";
|
|
|
|
import { BaseNotificationHandler } from "./base-notification.handler";
|
|
import { IChangePasswordNotificationData } from "../interfaces/ISendNotificationData";
|
|
import { NotificationsService } from "../services/notifications.service";
|
|
|
|
@Injectable()
|
|
export class ChangePasswordHandler extends BaseNotificationHandler<IChangePasswordNotificationData> {
|
|
protected readonly logger = new Logger(ChangePasswordHandler.name);
|
|
|
|
constructor(private readonly notificationsService: NotificationsService) {
|
|
super();
|
|
}
|
|
|
|
protected async handle(recipientId: string, data: IChangePasswordNotificationData, em: EntityManager): Promise<void> {
|
|
await this.notificationsService.changePasswordNotification(recipientId, data, em);
|
|
}
|
|
|
|
protected getHandlerName(): string {
|
|
return "ChangePassword";
|
|
}
|
|
}
|