fix(server): only returns active subscriptions (#6590)

This commit is contained in:
liuyi 2024-04-17 16:19:34 +08:00 committed by GitHub
parent c7373d4651
commit 5b315bfc81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -369,6 +369,7 @@ export class UserSubscriptionResolver {
return this.db.userSubscription.findMany({
where: {
userId: user.id,
status: SubscriptionStatus.Active,
},
});
}

View File

@ -765,7 +765,9 @@ export class SubscriptionService {
);
return {
price,
coupon: !subscribed ? CouponType.ProEarlyAccessOneYearFree : undefined,
coupon: canHaveEADiscount
? CouponType.ProEarlyAccessOneYearFree
: undefined,
};
} else {
const isAIEaUser = await this.features.isEarlyAccessUser(