mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 09:36:17 +08:00
refactor(server): permission (#10449)
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
SubscriptionPlanNotFound,
|
||||
URLHelper,
|
||||
} from '../../../base';
|
||||
import { Models } from '../../../models';
|
||||
import {
|
||||
KnownStripeInvoice,
|
||||
KnownStripePrice,
|
||||
@@ -48,7 +49,8 @@ export class WorkspaceSubscriptionManager extends SubscriptionManager {
|
||||
stripe: Stripe,
|
||||
db: PrismaClient,
|
||||
private readonly url: URLHelper,
|
||||
private readonly event: EventBus
|
||||
private readonly event: EventBus,
|
||||
private readonly models: Models
|
||||
) {
|
||||
super(stripe, db);
|
||||
}
|
||||
@@ -101,11 +103,7 @@ export class WorkspaceSubscriptionManager extends SubscriptionManager {
|
||||
return { allow_promotion_codes: true };
|
||||
})();
|
||||
|
||||
const count = await this.db.workspaceUserPermission.count({
|
||||
where: {
|
||||
workspaceId: args.workspaceId,
|
||||
},
|
||||
});
|
||||
const count = await this.models.workspaceUser.count(args.workspaceId);
|
||||
|
||||
return this.stripe.checkout.sessions.create({
|
||||
customer: customer.stripeCustomerId,
|
||||
|
||||
Reference in New Issue
Block a user