Removed hasActiveStripeSubscriptions endpoint (#14689)

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

This endpoint is no longer used in 5.0
This commit is contained in:
Fabien 'egg' O'Carroll 2022-05-04 17:25:21 +01:00 committed by GitHub
parent cf9231e77a
commit 2da52130a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 23 deletions

View File

@ -34,18 +34,6 @@ const allowedIncludes = ['email_recipients', 'products'];
module.exports = {
docName: 'members',
hasActiveStripeSubscriptions: {
permissions: {
method: 'browse'
},
async query() {
const hasActiveStripeSubscriptions = await membersService.api.hasActiveStripeSubscriptions();
return {
hasActiveStripeSubscriptions
};
}
},
browse: {
options: [
'limit',

View File

@ -128,8 +128,8 @@ module.exports = {
method: 'edit'
},
async query(frame) {
const hasActiveStripeSubscriptions = await membersService.api.hasActiveStripeSubscriptions();
if (hasActiveStripeSubscriptions) {
const paidMembers = await membersService.api.memberBREADService.browse({limit: 0, filter: 'status:paid'});
if (_.get(paidMembers, 'meta.pagination.total') !== 0) {
throw new BadRequestError({
message: 'Cannot disconnect Stripe whilst you have active subscriptions.'
});

View File

@ -4,8 +4,6 @@ const {unparse} = require('@tryghost/members-csv');
const labsService = require('../../../../../../shared/labs');
module.exports = {
hasActiveStripeSubscriptions: createSerializer('hasActiveStripeSubscriptions', passthrough),
browse: createSerializer('browse', paginatedMembers),
read: createSerializer('read', singleMember),
edit: createSerializer('edit', singleMember),

View File

@ -123,8 +123,6 @@ module.exports = function apiRoutes() {
http(api.members.importCSV)
);
router.get('/members/hasActiveStripeSubscriptions', mw.authAdminApi, http(api.members.hasActiveStripeSubscriptions));
router.get('/members/stripe_connect', mw.authAdminApi, http(api.membersStripeConnect.auth));
router.get('/members/:id', mw.authAdminApi, http(api.members.read));

View File

@ -85,7 +85,7 @@
"@tryghost/logging": "2.1.8",
"@tryghost/magic-link": "1.0.24",
"@tryghost/member-events": "0.4.4",
"@tryghost/members-api": "6.3.1",
"@tryghost/members-api": "7.0.0",
"@tryghost/members-events-service": "0.4.1",
"@tryghost/members-importer": "0.5.12",
"@tryghost/members-offers": "0.11.4",

View File

@ -2148,10 +2148,10 @@
"@tryghost/domain-events" "^0.1.12"
"@tryghost/member-events" "^0.4.4"
"@tryghost/members-api@6.3.1":
version "6.3.1"
resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-6.3.1.tgz#65f62075936cd7ee5dab4b818c4e90ae69a8814d"
integrity sha512-FMCv2Q3hl8EN0xbyJVnsOfUCJ8MQiXxgmPYwc01n4nfyLM95WjueVB1rH7KOrjy8vIPuw8D4qKAyItHF/k/XHw==
"@tryghost/members-api@7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-7.0.0.tgz#5a3606187f673264462535e83957514cd402f386"
integrity sha512-rF66jEdw+OyEjcrdd/REJlqgUQYwSGxeZjm1RAdVMUaC5vqSVoMuZDS4uNPN1L9rW22vLFn7IOV9CA9L2bXSZA==
dependencies:
"@nexes/nql" "^0.6.0"
"@tryghost/debug" "^0.1.2"