Skip to content

Commit 27c9f6d

Browse files
committed
fix example
1 parent 49d1750 commit 27c9f6d

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

example/convex/_generated/api.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export declare const components: {
113113
id: string;
114114
metadata: Record<string, any>;
115115
modifiedAt: string | null;
116-
priceId: string;
116+
priceId?: string;
117117
productId: string;
118118
recurringInterval: "month" | "year" | null;
119119
startedAt: string | null;
@@ -141,7 +141,7 @@ export declare const components: {
141141
id: string;
142142
metadata: Record<string, any>;
143143
modifiedAt: string | null;
144-
priceId: string;
144+
priceId?: string;
145145
product: {
146146
createdAt: string;
147147
description: string | null;
@@ -264,7 +264,7 @@ export declare const components: {
264264
id: string;
265265
metadata: Record<string, any>;
266266
modifiedAt: string | null;
267-
priceId: string;
267+
priceId?: string;
268268
productId: string;
269269
recurringInterval: "month" | "year" | null;
270270
startedAt: string | null;
@@ -296,7 +296,7 @@ export declare const components: {
296296
id: string;
297297
metadata: Record<string, any>;
298298
modifiedAt: string | null;
299-
priceId: string;
299+
priceId?: string;
300300
productId: string;
301301
recurringInterval: "month" | "year" | null;
302302
startedAt: string | null;
@@ -371,7 +371,7 @@ export declare const components: {
371371
id: string;
372372
metadata: Record<string, any>;
373373
modifiedAt: string | null;
374-
priceId: string;
374+
priceId?: string;
375375
product: {
376376
createdAt: string;
377377
description: string | null;
@@ -490,7 +490,7 @@ export declare const components: {
490490
id: string;
491491
metadata: Record<string, any>;
492492
modifiedAt: string | null;
493-
priceId: string;
493+
priceId?: string;
494494
productId: string;
495495
recurringInterval: "month" | "year" | null;
496496
startedAt: string | null;

example/convex/example.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const currentUser = async (ctx: QueryCtx) => {
8888
isPremiumPlus,
8989
subscription,
9090
maxTodos: isPremiumPlus
91-
? MAX_PREMIUM_TODOS
91+
? undefined
9292
: isPremium
9393
? MAX_PREMIUM_TODOS
9494
: MAX_FREE_TODOS,
@@ -137,8 +137,7 @@ export const insertTodo = mutation({
137137
throw new Error("Reached maximum number of todos for free plan");
138138
}
139139
if (
140-
(productKey === "premiumMonthly" ||
141-
productKey === "premiumPlusMonthly") &&
140+
(productKey === "premiumMonthly" || productKey === "premiumYearly") &&
142141
todoCount >= MAX_PREMIUM_TODOS
143142
) {
144143
throw new Error("Reached maximum number of todos for premium plan");

example/src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export default function TodoList() {
2929
const [newTodo, setNewTodo] = useState("");
3030

3131
const todosLength = todos?.length ?? 0;
32+
console.log("user", user);
3233
const isAtMaxTodos = user?.maxTodos && todosLength >= user.maxTodos;
3334

3435
const {

src/component/_generated/api.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export type Mounts = {
9999
id: string;
100100
metadata: Record<string, any>;
101101
modifiedAt: string | null;
102-
priceId: string;
102+
priceId?: string;
103103
productId: string;
104104
recurringInterval: "month" | "year" | null;
105105
startedAt: string | null;
@@ -127,7 +127,7 @@ export type Mounts = {
127127
id: string;
128128
metadata: Record<string, any>;
129129
modifiedAt: string | null;
130-
priceId: string;
130+
priceId?: string;
131131
product: {
132132
createdAt: string;
133133
description: string | null;
@@ -250,7 +250,7 @@ export type Mounts = {
250250
id: string;
251251
metadata: Record<string, any>;
252252
modifiedAt: string | null;
253-
priceId: string;
253+
priceId?: string;
254254
productId: string;
255255
recurringInterval: "month" | "year" | null;
256256
startedAt: string | null;
@@ -282,7 +282,7 @@ export type Mounts = {
282282
id: string;
283283
metadata: Record<string, any>;
284284
modifiedAt: string | null;
285-
priceId: string;
285+
priceId?: string;
286286
productId: string;
287287
recurringInterval: "month" | "year" | null;
288288
startedAt: string | null;
@@ -357,7 +357,7 @@ export type Mounts = {
357357
id: string;
358358
metadata: Record<string, any>;
359359
modifiedAt: string | null;
360-
priceId: string;
360+
priceId?: string;
361361
product: {
362362
createdAt: string;
363363
description: string | null;
@@ -476,7 +476,7 @@ export type Mounts = {
476476
id: string;
477477
metadata: Record<string, any>;
478478
modifiedAt: string | null;
479-
priceId: string;
479+
priceId?: string;
480480
productId: string;
481481
recurringInterval: "month" | "year" | null;
482482
startedAt: string | null;

0 commit comments

Comments
 (0)