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:
parent
f84ce23332
commit
928328b380
1 changed files with 2 additions and 1 deletions
|
|
@ -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' },
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue