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

@@ -113,7 +113,7 @@ export declare const components: {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
productId: string; productId: string;
recurringInterval: "month" | "year" | null; recurringInterval: "month" | "year" | null;
startedAt: string | null; startedAt: string | null;
@@ -141,7 +141,7 @@ export declare const components: {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
product: { product: {
createdAt: string; createdAt: string;
description: string | null; description: string | null;
@@ -264,7 +264,7 @@ export declare const components: {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
productId: string; productId: string;
recurringInterval: "month" | "year" | null; recurringInterval: "month" | "year" | null;
startedAt: string | null; startedAt: string | null;
@@ -296,7 +296,7 @@ export declare const components: {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
productId: string; productId: string;
recurringInterval: "month" | "year" | null; recurringInterval: "month" | "year" | null;
startedAt: string | null; startedAt: string | null;
@@ -371,7 +371,7 @@ export declare const components: {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
product: { product: {
createdAt: string; createdAt: string;
description: string | null; description: string | null;
@@ -490,7 +490,7 @@ export declare const components: {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
productId: string; productId: string;
recurringInterval: "month" | "year" | null; recurringInterval: "month" | "year" | null;
startedAt: string | null; startedAt: string | null;

View File

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

View File

@@ -29,6 +29,7 @@ export default function TodoList() {
const [newTodo, setNewTodo] = useState(""); const [newTodo, setNewTodo] = useState("");
const todosLength = todos?.length ?? 0; const todosLength = todos?.length ?? 0;
console.log("user", user);
const isAtMaxTodos = user?.maxTodos && todosLength >= user.maxTodos; const isAtMaxTodos = user?.maxTodos && todosLength >= user.maxTodos;
const { const {

View File

@@ -99,7 +99,7 @@ export type Mounts = {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
productId: string; productId: string;
recurringInterval: "month" | "year" | null; recurringInterval: "month" | "year" | null;
startedAt: string | null; startedAt: string | null;
@@ -127,7 +127,7 @@ export type Mounts = {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
product: { product: {
createdAt: string; createdAt: string;
description: string | null; description: string | null;
@@ -250,7 +250,7 @@ export type Mounts = {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
productId: string; productId: string;
recurringInterval: "month" | "year" | null; recurringInterval: "month" | "year" | null;
startedAt: string | null; startedAt: string | null;
@@ -282,7 +282,7 @@ export type Mounts = {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
productId: string; productId: string;
recurringInterval: "month" | "year" | null; recurringInterval: "month" | "year" | null;
startedAt: string | null; startedAt: string | null;
@@ -357,7 +357,7 @@ export type Mounts = {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
product: { product: {
createdAt: string; createdAt: string;
description: string | null; description: string | null;
@@ -476,7 +476,7 @@ export type Mounts = {
id: string; id: string;
metadata: Record<string, any>; metadata: Record<string, any>;
modifiedAt: string | null; modifiedAt: string | null;
priceId: string; priceId?: string;
productId: string; productId: string;
recurringInterval: "month" | "year" | null; recurringInterval: "month" | "year" | null;
startedAt: string | null; startedAt: string | null;