0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Renamed HandleEvent -> OnEvent

This commit is contained in:
Fabien "egg" O'Carroll 2023-12-06 17:42:26 +07:00
parent cad0da1d20
commit 38e5935d40
2 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ type EventRegistrationSpec<EventData, Subscriber> = {
const events: EventRegistrationSpec<unknown, unknown>[] = [];
export function HandleEvent<T>(Event: new (data: T, timestamp: Date) => IEvent<T>) {
export function OnEvent<T>(Event: new (data: T, timestamp: Date) => IEvent<T>) {
return function (target: object, methodName: string) {
events.push({
Event: Event as new (data: unknown, timestamp: Date) => IEvent<T>,

View file

@ -1,6 +1,6 @@
import {MilestoneCreatedEvent} from '@tryghost/milestones';
import {SlackNotifications} from '@tryghost/slack-notifications';
import {HandleEvent} from '../common/handle-event.decorator';
import {OnEvent} from '../common/handle-event.decorator';
import {Inject} from '@nestjs/common';
interface IConfig {
@ -18,7 +18,7 @@ export class SlackNotificationsListener {
this.enabled = hostSettings?.milestones?.url && hostSettings?.milestones?.enabled;
}
@HandleEvent(MilestoneCreatedEvent)
@OnEvent(MilestoneCreatedEvent)
async notifyMilestones(event: typeof MilestoneCreatedEvent) {
if (!this.enabled) {
return;