feat: Add by_owner index to the projects table, remove redundant query filter, and update isAuthenticated export.
This commit is contained in:
@@ -9,8 +9,7 @@ export const getProjects = query({
|
||||
if (!userId) return [];
|
||||
return await ctx.db
|
||||
.query("projects")
|
||||
.withIndex("by_owner", (q) => q.eq("userId", userId)) // Note: Need to add index to schema too? Or just filter? Schema doesn't define indexes yet. Will rely on filter for now or filter in memory if small. Actually, will rely on simple filter or add index later.
|
||||
.filter((q) => q.eq(q.field("userId"), userId))
|
||||
.withIndex("by_owner", (q) => q.eq("userId", userId))
|
||||
.collect();
|
||||
},
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ const schema = defineSchema({
|
||||
dorkingConfig: v.object({
|
||||
selectedSourceIds: v.array(v.id("dataSources")),
|
||||
}),
|
||||
}),
|
||||
}).index("by_owner", ["userId"]),
|
||||
dataSources: defineTable({
|
||||
projectId: v.id("projects"),
|
||||
type: v.literal("website"),
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
2026-02-03 16:43:46 - Fixed 'NoAuthProvider' error by adding Password provider to `convex/auth.config.ts`.
|
||||
2026-02-03 16:46:52 - Added Google OAuth provider to `convex/auth.config.ts` to fix 'Provider google is not configured' error.
|
||||
2026-02-03 17:05:00 - Exported 'isAuthenticated' from 'convex/auth.ts' to fix missing export error.
|
||||
## 2026-02-03 18:54:04 - Fixed convex-auth isAuthenticated export
|
||||
|
||||
- Updated `convex/auth.ts` to export `isAuthenticated` directly from `convexAuth()` as required by convex-auth 0.0.76+
|
||||
- Removed manual fallback query for `isAuthenticated`
|
||||
- Cleaned up unused imports (`getAuthUserId`, `query`)
|
||||
|
||||
|
||||
- Ran `npx convex dev --once` to regenerate Convex API types and sync the new `isAuthenticated` export
|
||||
|
||||
- Added missing `by_owner` index on `userId` to the `projects` table in `convex/schema.ts`
|
||||
- Removed redundant `.filter()` call in `convex/projects.ts` getProjects query
|
||||
|
||||
|
||||
Reference in New Issue
Block a user