mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
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:
parent
470ed05620
commit
4def34ef21
@ -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: [
|
||||
|
@ -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)
|
||||
};
|
||||
|
||||
|
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user