mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 04:26:23 +08:00
fix(server): separate active subscriptions (#13077)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved accuracy of subscription management by ensuring only active or trialing subscriptions are considered in all relevant user, workspace, and license actions. * Enhanced consistency in subscription retrieval for workspace member updates and subscription-related operations. * **Refactor** * Updated internal subscription retrieval methods to distinguish between general and active subscriptions for more precise handling across the app. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -159,7 +159,7 @@ export class SubscriptionService {
|
||||
this.assertSubscriptionIdentity(identity);
|
||||
|
||||
const manager = this.select(identity.plan);
|
||||
const subscription = await manager.getSubscription(identity);
|
||||
const subscription = await manager.getActiveSubscription(identity);
|
||||
|
||||
if (!subscription) {
|
||||
throw new SubscriptionNotExists({ plan: identity.plan });
|
||||
@@ -205,7 +205,7 @@ export class SubscriptionService {
|
||||
|
||||
const manager = this.select(identity.plan);
|
||||
|
||||
const subscription = await manager.getSubscription(identity);
|
||||
const subscription = await manager.getActiveSubscription(identity);
|
||||
|
||||
if (!subscription) {
|
||||
throw new SubscriptionNotExists({ plan: identity.plan });
|
||||
@@ -252,7 +252,7 @@ export class SubscriptionService {
|
||||
this.assertSubscriptionIdentity(identity);
|
||||
|
||||
const manager = this.select(identity.plan);
|
||||
const subscription = await manager.getSubscription(identity);
|
||||
const subscription = await manager.getActiveSubscription(identity);
|
||||
|
||||
if (!subscription) {
|
||||
throw new SubscriptionNotExists({ plan: identity.plan });
|
||||
@@ -304,7 +304,7 @@ export class SubscriptionService {
|
||||
) {
|
||||
this.assertSubscriptionIdentity(identity);
|
||||
|
||||
const subscription = await this.select(identity.plan).getSubscription(
|
||||
const subscription = await this.select(identity.plan).getActiveSubscription(
|
||||
identity
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user