fix example

This commit is contained in:
Shawn Erquhart
2025-04-22 17:28:33 -04:00
parent 49d1750e47
commit 27c9f6dd71
4 changed files with 15 additions and 15 deletions

View File

@@ -88,7 +88,7 @@ const currentUser = async (ctx: QueryCtx) => {
isPremiumPlus,
subscription,
maxTodos: isPremiumPlus
? MAX_PREMIUM_TODOS
? undefined
: isPremium
? MAX_PREMIUM_TODOS
: MAX_FREE_TODOS,
@@ -137,8 +137,7 @@ export const insertTodo = mutation({
throw new Error("Reached maximum number of todos for free plan");
}
if (
(productKey === "premiumMonthly" ||
productKey === "premiumPlusMonthly") &&
(productKey === "premiumMonthly" || productKey === "premiumYearly") &&
todoCount >= MAX_PREMIUM_TODOS
) {
throw new Error("Reached maximum number of todos for premium plan");