mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
Merge branch 'main' into feat/separate-document-page
This commit is contained in:
@ -2,15 +2,14 @@ import type { Subscription } from '.prisma/client';
|
||||
import { SubscriptionStatus } from '.prisma/client';
|
||||
|
||||
/**
|
||||
* Returns true if there is a subscription that is active and is a community plan.
|
||||
* Returns true if there is a subscription that is active and is one of the provided price IDs.
|
||||
*/
|
||||
export const subscriptionsContainsActiveCommunityPlan = (
|
||||
export const subscriptionsContainsActivePlan = (
|
||||
subscriptions: Subscription[],
|
||||
communityPlanPriceIds: string[],
|
||||
priceIds: string[],
|
||||
) => {
|
||||
return subscriptions.some(
|
||||
(subscription) =>
|
||||
subscription.status === SubscriptionStatus.ACTIVE &&
|
||||
communityPlanPriceIds.includes(subscription.priceId),
|
||||
subscription.status === SubscriptionStatus.ACTIVE && priceIds.includes(subscription.priceId),
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user