Added "api" source to MemberSubscribedEvents

refs https://github.com/TryGhost/Team/issues/1275

We want to be able to track where member subscriptions came from, so
that we can use the information to reduce spam imports of members.

We were missing information when members were uploaded via the Admin
API, and setting the source to 'member' be default - this fixes that
both when creating members and when updating their subscription status.
This commit is contained in:
Fabien "egg" O'Carroll 2022-01-14 12:03:35 +02:00 committed by Fabien 'egg' O'Carroll
parent 5652f1169f
commit cacc74f3b4

View File

@ -151,6 +151,8 @@ module.exports = class MemberRepository {
source = 'system';
} else if (context.user) {
source = 'admin';
} else if (context.api_key) {
source = 'api';
} else {
source = 'member';
}
@ -266,6 +268,8 @@ module.exports = class MemberRepository {
source = 'system';
} else if (context.user) {
source = 'admin';
} else if (context.api_key) {
source = 'api';
} else {
source = 'member';
}