From e991f4f1854e2459bf8d9cd2d8c683f45f094ae2 Mon Sep 17 00:00:00 2001 From: Madhura68 Date: Sat, 25 Apr 2026 19:17:05 +0200 Subject: [PATCH] feat(todos): include team-member products in todos page query Use productAccessFilter so users who are product members (not just owners) see those products in the todo form and promote dialogs. Co-Authored-By: Claude Sonnet 4.6 --- app/(app)/todos/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/(app)/todos/page.tsx b/app/(app)/todos/page.tsx index 8c63e09..b2c6fd3 100644 --- a/app/(app)/todos/page.tsx +++ b/app/(app)/todos/page.tsx @@ -2,6 +2,7 @@ import { cookies } from 'next/headers' import { getIronSession } from 'iron-session' import { SessionData, sessionOptions } from '@/lib/session' import { prisma } from '@/lib/prisma' +import { productAccessFilter } from '@/lib/product-access' import { TodoList } from '@/components/todos/todo-list' export default async function TodosPage() { @@ -14,7 +15,7 @@ export default async function TodosPage() { }) const products = await prisma.product.findMany({ - where: { user_id: session.userId, archived: false }, + where: { ...productAccessFilter(session.userId), archived: false }, orderBy: { name: 'asc' }, include: { pbis: { orderBy: [{ priority: 'asc' }, { sort_order: 'asc' }], select: { id: true, title: true } },