mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-10 06:31:49 +02:00
✨ Self-Hosting Update (#842)
This commit is contained in:
parent
3e616d1e41
commit
7a5f9ae474
51 changed files with 945 additions and 781 deletions
|
@ -18,8 +18,8 @@ export const getSubscriptionStatus = async (userId: string) => {
|
|||
if (user?.subscription?.active === true) {
|
||||
return {
|
||||
active: true,
|
||||
expiresAt: user.subscription.periodEnd,
|
||||
};
|
||||
legacy: false,
|
||||
} as const;
|
||||
}
|
||||
|
||||
const userPaymentData = await prisma.userPaymentData.findFirst({
|
||||
|
@ -34,18 +34,14 @@ export const getSubscriptionStatus = async (userId: string) => {
|
|||
},
|
||||
});
|
||||
|
||||
if (
|
||||
userPaymentData?.endDate &&
|
||||
userPaymentData.endDate.getTime() > Date.now()
|
||||
) {
|
||||
if (userPaymentData) {
|
||||
return {
|
||||
active: true,
|
||||
legacy: true,
|
||||
expiresAt: userPaymentData.endDate,
|
||||
};
|
||||
} as const;
|
||||
}
|
||||
|
||||
return {
|
||||
active: false,
|
||||
};
|
||||
} as const;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue