feat(pricing/ai): improve billing metered pricing + add pricing on ai chat (#14092)
## TODO: - [x] display "yearly" or "monthly" wording everywhere it's needed - [ ] Add button with "downgrade" or "upgrade" to save the change of credits price + modal to validate - [x] Add renewal date - [ ] Implement https://docs.stripe.com/billing/subscriptions/subscription-schedules for `switchFromYearlyToMonthly` and decrease number of credits
This commit is contained in:
+3
-4
@@ -21,10 +21,9 @@ export const getDeletedStripeSubscriptionItemIdsFromStripeSubscriptionEvent = (
|
||||
const subscriptionItemIds =
|
||||
event.data.object.items.data.map((item) => item.id) ?? [];
|
||||
|
||||
const deletedSubscriptionItemIds =
|
||||
return (
|
||||
event.data.previous_attributes?.items?.data
|
||||
.filter((item) => !subscriptionItemIds.includes(item.id))
|
||||
.map((item) => item.id) ?? [];
|
||||
|
||||
return deletedSubscriptionItemIds;
|
||||
.map((item) => item.id) ?? []
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user