diff --git a/ghost/ghost/src/common/handle-event.decorator.ts b/ghost/ghost/src/common/handle-event.decorator.ts index 96426dac8c..8d6c09b52b 100644 --- a/ghost/ghost/src/common/handle-event.decorator.ts +++ b/ghost/ghost/src/common/handle-event.decorator.ts @@ -18,7 +18,7 @@ type EventRegistrationSpec = { const events: EventRegistrationSpec[] = []; -export function HandleEvent(Event: new (data: T, timestamp: Date) => IEvent) { +export function OnEvent(Event: new (data: T, timestamp: Date) => IEvent) { return function (target: object, methodName: string) { events.push({ Event: Event as new (data: unknown, timestamp: Date) => IEvent, diff --git a/ghost/ghost/src/listeners/slack-notifications.listener.ts b/ghost/ghost/src/listeners/slack-notifications.listener.ts index 14c0c31a7d..0f6cf77ef0 100644 --- a/ghost/ghost/src/listeners/slack-notifications.listener.ts +++ b/ghost/ghost/src/listeners/slack-notifications.listener.ts @@ -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;