Ghost/ghost/member-events
Simon Backx 1290477d71
Added member last seen update on link click (#15459)
fixes https://github.com/TryGhost/Team/issues/1952

Adds a new MemberLinkClickEvent event that is fired when a member clicks a link. This code has been added to the `linkClickRepository` because that is the only place that has access to the member model (and the event requires the id and current last seen at value). The LastSeenAtUpdater listens for this event and updates the timestamp if required.
2022-09-23 10:34:33 +02:00
..
lib Added member last seen update on link click (#15459) 2022-09-23 10:34:33 +02:00
test
.eslintrc.js
index.js Added member last seen update on link click (#15459) 2022-09-23 10:34:33 +02:00
package.json
README.md

Member Events

Usage

const {MemberEntryViewEvent} = require('@tryghost/member-events');

const event = MemberEntryViewEvent.create({
    memberId: member.id,
    memberStatus: member.status,
    entryId: post.id,
    entryUrl: post.url
});

const DomainEvents = require('@tryghost/domain-events');

DomainEvents.dispatch(event);