feat: check quota correctly (#6561)

This commit is contained in:
darkskygit
2024-04-16 09:41:48 +00:00
parent 0ca8a23dd8
commit 1b0864eb60
26 changed files with 309 additions and 95 deletions

View File

@@ -527,7 +527,10 @@ export class SubscriptionService {
nextBillAt = new Date(subscription.current_period_end * 1000);
}
} else {
this.event.emit('user.subscription.canceled', user.id);
this.event.emit('user.subscription.canceled', {
userId: user.id,
plan,
});
}
const commonData = {

View File

@@ -53,7 +53,10 @@ declare module '../../fundamentals/event/def' {
userId: User['id'];
plan: SubscriptionPlan;
}>;
canceled: Payload<User['id']>;
canceled: Payload<{
userId: User['id'];
plan: SubscriptionPlan;
}>;
};
}
}