bug fixes

This commit is contained in:
daniel31x13
2024-10-30 16:47:40 -04:00
parent fa1f9873d5
commit 508844dd9d
9 changed files with 82 additions and 30 deletions
+9 -1
View File
@@ -8,7 +8,15 @@ export const hasPassedLimit = async (
numberOfImports: number
) => {
if (!stripeEnabled) {
return false;
const totalLinks = await prisma.link.count({
where: {
createdBy: {
id: userId,
},
},
});
return MAX_LINKS_PER_USER - (numberOfImports + totalLinks) < 0;
}
const user = await prisma.user.findUnique({