mirror of
https://github.com/LukeHagar/polar.git
synced 2025-12-06 04:20:58 +00:00
fix example
This commit is contained in:
12
example/convex/_generated/api.d.ts
vendored
12
example/convex/_generated/api.d.ts
vendored
@@ -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;
|
||||||
|
|||||||
@@ -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");
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
12
src/component/_generated/api.d.ts
vendored
12
src/component/_generated/api.d.ts
vendored
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user