diff --git a/src/app/admin/stocks/page.tsx b/src/app/admin/stocks/page.tsx index d2f367d..26bcbe4 100644 --- a/src/app/admin/stocks/page.tsx +++ b/src/app/admin/stocks/page.tsx @@ -29,7 +29,7 @@ export default async function AdminStocksPage({ searchParams }: Props) { skip, take: pageSize, include: { - _count: { select: { positions: true, trades: true } }, + _count: { select: { positions: { where: { shares: { gt: 0 } } }, trades: true } }, }, }), prisma.hashtag.count({ where }), diff --git a/src/app/stocks/page.tsx b/src/app/stocks/page.tsx index bfc3439..45c501c 100644 --- a/src/app/stocks/page.tsx +++ b/src/app/stocks/page.tsx @@ -86,7 +86,7 @@ export default async function StocksPage({ searchParams }: PageProps) { take: 2, select: { price: true, postsPerHour: true }, }, - _count: { select: { positions: true } }, + _count: { select: { positions: { where: { shares: { gt: 0 } } } } }, }, }) @@ -138,7 +138,7 @@ export default async function StocksPage({ searchParams }: PageProps) { take: 2, select: { price: true, postsPerHour: true }, }, - _count: { select: { positions: true } }, + _count: { select: { positions: { where: { shares: { gt: 0 } } } } }, }, }) .then((rows) =>