Refine hashtag and stock query counts to only include positions with shares greater than zero
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m48s
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m48s
This commit is contained in:
@@ -29,7 +29,7 @@ export default async function AdminStocksPage({ searchParams }: Props) {
|
|||||||
skip,
|
skip,
|
||||||
take: pageSize,
|
take: pageSize,
|
||||||
include: {
|
include: {
|
||||||
_count: { select: { positions: true, trades: true } },
|
_count: { select: { positions: { where: { shares: { gt: 0 } } }, trades: true } },
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
prisma.hashtag.count({ where }),
|
prisma.hashtag.count({ where }),
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export default async function StocksPage({ searchParams }: PageProps) {
|
|||||||
take: 2,
|
take: 2,
|
||||||
select: { price: true, postsPerHour: true },
|
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,
|
take: 2,
|
||||||
select: { price: true, postsPerHour: true },
|
select: { price: true, postsPerHour: true },
|
||||||
},
|
},
|
||||||
_count: { select: { positions: true } },
|
_count: { select: { positions: { where: { shares: { gt: 0 } } } } },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((rows) =>
|
.then((rows) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user