fix(ST-102): show products via membership on dashboard, not just owned

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-04-26 17:12:42 +02:00
parent f84ce23332
commit 928328b380

View file

@ -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 Link from 'next/link'
import { Button } from '@/components/ui/button'
import { ProductList } from '@/components/dashboard/product-list'
@ -16,7 +17,7 @@ export default async function DashboardPage({ searchParams }: Props) {
const showArchived = archived === '1'
const products = await prisma.product.findMany({
where: { user_id: session.userId, archived: showArchived },
where: { archived: showArchived, ...productAccessFilter(session.userId) },
orderBy: { created_at: 'desc' },
})