mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-08 02:52:39 -05:00
Removed comped
flag from canary Members Admin API
refs https://github.com/TryGhost/Team/issues/693 Since we no longer have a concept of "comped" we're removing the flag from the unstable canary api.
This commit is contained in:
parent
5cabc39124
commit
57a176ff3d
5 changed files with 0 additions and 23 deletions
|
@ -79,20 +79,6 @@ function exportCSV(page, _apiConfig, frame) {
|
|||
function serializeMember(member, options) {
|
||||
const json = member.toJSON(options);
|
||||
|
||||
let comped = false;
|
||||
if (json.subscriptions) {
|
||||
const hasCompedSubscription = !!json.subscriptions.find(
|
||||
/**
|
||||
* @param {SerializedMemberStripeSubscription} sub
|
||||
*/
|
||||
function (sub) {
|
||||
return sub.plan.nickname === 'Complimentary' && sub.status === 'active';
|
||||
}
|
||||
);
|
||||
if (hasCompedSubscription) {
|
||||
comped = true;
|
||||
}
|
||||
}
|
||||
const subscriptions = json.subscriptions || [];
|
||||
|
||||
const serialized = {
|
||||
|
@ -108,7 +94,6 @@ function serializeMember(member, options) {
|
|||
labels: json.labels,
|
||||
subscriptions: subscriptions,
|
||||
avatar_image: json.avatar_image,
|
||||
comped: comped,
|
||||
email_count: json.email_count,
|
||||
email_opened_count: json.email_opened_count,
|
||||
email_open_rate: json.email_open_rate,
|
||||
|
@ -163,7 +148,6 @@ function createSerializer(debugString, serialize) {
|
|||
* @prop {SerializedMemberStripeSubscription[]} subscriptions
|
||||
* @prop {SerializedMemberProduct[]=} products
|
||||
* @prop {string} avatar_image
|
||||
* @prop {boolean} comped
|
||||
* @prop {number} email_count
|
||||
* @prop {number} email_opened_count
|
||||
* @prop {number} email_open_rate
|
||||
|
|
|
@ -358,7 +358,6 @@ describe('Members API', function () {
|
|||
importedMember1.subscribed.should.equal(true);
|
||||
importedMember1.labels.length.should.equal(1);
|
||||
testUtils.API.isISO8601(importedMember1.created_at).should.be.true();
|
||||
importedMember1.comped.should.equal(false);
|
||||
importedMember1.subscriptions.should.not.be.undefined();
|
||||
importedMember1.subscriptions.length.should.equal(0);
|
||||
|
||||
|
@ -370,7 +369,6 @@ describe('Members API', function () {
|
|||
importedMember2.labels.length.should.equal(2);
|
||||
testUtils.API.isISO8601(importedMember2.created_at).should.be.true();
|
||||
importedMember2.created_at.should.equal('1991-10-02T20:30:31.000Z');
|
||||
importedMember2.comped.should.equal(false);
|
||||
importedMember2.subscriptions.should.not.be.undefined();
|
||||
importedMember2.subscriptions.length.should.equal(0);
|
||||
});
|
||||
|
|
|
@ -127,7 +127,6 @@ const expectedProperties = {
|
|||
member: _(schema.members)
|
||||
.keys()
|
||||
.concat('avatar_image')
|
||||
.concat('comped')
|
||||
.concat('labels')
|
||||
,
|
||||
member_signin_url: ['member_id', 'url'],
|
||||
|
|
|
@ -491,7 +491,6 @@ describe('Members API (canary)', function () {
|
|||
should(importedMember1.name).equal(null);
|
||||
should(importedMember1.note).equal(null);
|
||||
importedMember1.subscribed.should.equal(true);
|
||||
importedMember1.comped.should.equal(false);
|
||||
importedMember1.subscriptions.should.not.be.undefined();
|
||||
importedMember1.subscriptions.length.should.equal(0);
|
||||
|
||||
|
@ -558,7 +557,6 @@ describe('Members API (canary)', function () {
|
|||
should(importedMember1.name).equal('Hannah');
|
||||
should(importedMember1.note).equal('no need to map me');
|
||||
importedMember1.subscribed.should.equal(true);
|
||||
importedMember1.comped.should.equal(false);
|
||||
importedMember1.subscriptions.should.not.be.undefined();
|
||||
importedMember1.subscriptions.length.should.equal(0);
|
||||
importedMember1.labels.length.should.equal(1); // auto-generated import label
|
||||
|
@ -603,7 +601,6 @@ describe('Members API (canary)', function () {
|
|||
should(defaultMember1.name).equal(null);
|
||||
should(defaultMember1.note).equal(null);
|
||||
defaultMember1.subscribed.should.equal(true);
|
||||
defaultMember1.comped.should.equal(false);
|
||||
defaultMember1.subscriptions.should.not.be.undefined();
|
||||
defaultMember1.subscriptions.length.should.equal(0);
|
||||
defaultMember1.labels.length.should.equal(1); // auto-generated import label
|
||||
|
|
|
@ -86,7 +86,6 @@ const expectedProperties = {
|
|||
member: _(schema.members)
|
||||
.keys()
|
||||
.concat('avatar_image')
|
||||
.concat('comped')
|
||||
.concat('labels')
|
||||
,
|
||||
member_signin_url: ['member_id', 'url'],
|
||||
|
|
Loading…
Add table
Reference in a new issue