Removed unused members/stats endpoints

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

- These endpoints are unused, so they are safe to remove
- We're starting to remove as much unused & unnecessary code as possible to try to reduce the codebase and increase test coverage
This commit is contained in:
Hannah Wolfe 2022-03-29 13:59:07 +01:00
parent 470ed05620
commit 4def34ef21
No known key found for this signature in database
GPG Key ID: AB586C3B5AE5C037
3 changed files with 0 additions and 49 deletions

View File

@ -452,51 +452,6 @@ module.exports = {
};
}
},
subscriberStats: {
permissions: {
method: 'browse'
},
async query() {
const statsData = await membersService.api.events.getSubscriptions();
const totalSubscriptions = (_.last(statsData) && _.last(statsData).subscribed) || 0;
statsData.forEach((d) => {
d.date = moment(d.date).format('YYYY-MM-DD');
});
return {
resource: 'subscribers',
total: totalSubscriptions,
data: statsData.map((d) => {
return Object.assign({}, {
date: moment(d.date).format('YYYY-MM-DD'),
value: d.subscribed
});
})
};
}
},
grossVolumeStats: {
permissions: {
method: 'browse'
},
async query() {
const volumeData = await membersService.api.events.getVolume();
const volumeStats = Object.keys(volumeData).map((curr) => {
return {
currency: curr,
data: volumeData[curr].map((d) => {
return Object.assign({}, {
date: moment(d.date).format('YYYY-MM-DD'),
value: d.volume
});
})
};
});
return {
resource: 'gross-volume',
data: volumeStats
};
}
},
activityFeed: {
options: [

View File

@ -20,8 +20,6 @@ module.exports = {
importCSV: createSerializer('importCSV', passthrough),
memberStats: createSerializer('memberStats', passthrough),
mrrStats: createSerializer('mrrStats', passthrough),
subscriberStats: createSerializer('subscriberStats', passthrough),
grossVolumeStats: createSerializer('grossVolumeStats', passthrough),
activityFeed: createSerializer('activityFeed', passthrough)
};

View File

@ -113,8 +113,6 @@ module.exports = function apiRoutes() {
router.get('/members/stats/count', mw.authAdminApi, http(api.members.memberStats));
router.get('/members/stats/mrr', mw.authAdminApi, http(api.members.mrrStats));
router.get('/members/stats/subscribers', mw.authAdminApi, http(api.members.subscriberStats));
router.get('/members/stats/gross_volume', mw.authAdminApi, http(api.members.grossVolumeStats));
router.get('/members/events', mw.authAdminApi, http(api.members.activityFeed));