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

Updated status events to happen before subscribed events

no-issue

Given that status events are used to determine signup events,
they should be the first event for a member.
This commit is contained in:
Fabien O'Carroll 2021-03-05 12:39:30 +00:00
parent 58c9c1c649
commit d662003fdb

View file

@ -89,6 +89,12 @@ module.exports = class MemberRepository {
source = 'member'; source = 'member';
} }
await this._MemberStatusEvent.add({
member_id: member.id,
from_status: null,
to_status: member.get('status')
}, options);
if (member.get('subscribed')) { if (member.get('subscribed')) {
await this._MemberSubscribeEvent.add({ await this._MemberSubscribeEvent.add({
member_id: member.id, member_id: member.id,
@ -97,12 +103,6 @@ module.exports = class MemberRepository {
}, options); }, options);
} }
await this._MemberStatusEvent.add({
member_id: member.id,
from_status: null,
to_status: member.get('status')
}, options);
return member; return member;
} }