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();
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user