mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-03 18:40:00 +08:00
fix(core): optimize upgrade to team page (#9099)
This commit is contained in:
@@ -44,7 +44,12 @@ export class WorkspaceSubscription extends Entity {
|
||||
if (!this.store) {
|
||||
throw new Error('Subscription store not available');
|
||||
}
|
||||
await this.store.mutateResumeSubscription(idempotencyKey, plan);
|
||||
await this.store.mutateResumeSubscription(
|
||||
idempotencyKey,
|
||||
plan,
|
||||
undefined,
|
||||
this.workspaceService.workspace.id
|
||||
);
|
||||
await this.waitForRevalidation();
|
||||
}
|
||||
|
||||
@@ -52,7 +57,12 @@ export class WorkspaceSubscription extends Entity {
|
||||
if (!this.store) {
|
||||
throw new Error('Subscription store not available');
|
||||
}
|
||||
await this.store.mutateCancelSubscription(idempotencyKey, plan);
|
||||
await this.store.mutateCancelSubscription(
|
||||
idempotencyKey,
|
||||
plan,
|
||||
undefined,
|
||||
this.workspaceService.workspace.id
|
||||
);
|
||||
await this.waitForRevalidation();
|
||||
}
|
||||
|
||||
@@ -64,7 +74,12 @@ export class WorkspaceSubscription extends Entity {
|
||||
if (!this.store) {
|
||||
throw new Error('Subscription store not available');
|
||||
}
|
||||
await this.store.setSubscriptionRecurring(idempotencyKey, recurring, plan);
|
||||
await this.store.setSubscriptionRecurring(
|
||||
idempotencyKey,
|
||||
recurring,
|
||||
plan,
|
||||
this.workspaceService.workspace.id
|
||||
);
|
||||
await this.waitForRevalidation();
|
||||
}
|
||||
|
||||
|
||||
@@ -96,12 +96,14 @@ export class SubscriptionStore extends Store {
|
||||
async mutateResumeSubscription(
|
||||
idempotencyKey: string,
|
||||
plan?: SubscriptionPlan,
|
||||
abortSignal?: AbortSignal
|
||||
abortSignal?: AbortSignal,
|
||||
workspaceId?: string
|
||||
) {
|
||||
const data = await this.gqlService.gql({
|
||||
query: resumeSubscriptionMutation,
|
||||
variables: {
|
||||
plan,
|
||||
workspaceId,
|
||||
},
|
||||
context: {
|
||||
signal: abortSignal,
|
||||
@@ -116,12 +118,14 @@ export class SubscriptionStore extends Store {
|
||||
async mutateCancelSubscription(
|
||||
idempotencyKey: string,
|
||||
plan?: SubscriptionPlan,
|
||||
abortSignal?: AbortSignal
|
||||
abortSignal?: AbortSignal,
|
||||
workspaceId?: string
|
||||
) {
|
||||
const data = await this.gqlService.gql({
|
||||
query: cancelSubscriptionMutation,
|
||||
variables: {
|
||||
plan,
|
||||
workspaceId,
|
||||
},
|
||||
context: {
|
||||
signal: abortSignal,
|
||||
@@ -162,13 +166,15 @@ export class SubscriptionStore extends Store {
|
||||
setSubscriptionRecurring(
|
||||
idempotencyKey: string,
|
||||
recurring: SubscriptionRecurring,
|
||||
plan?: SubscriptionPlan
|
||||
plan?: SubscriptionPlan,
|
||||
workspaceId?: string
|
||||
) {
|
||||
return this.gqlService.gql({
|
||||
query: updateSubscriptionMutation,
|
||||
variables: {
|
||||
plan,
|
||||
recurring,
|
||||
workspaceId,
|
||||
},
|
||||
context: {
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user