This commit is contained in:
@@ -17,15 +17,20 @@ export default async function GlobalTradesPage({ searchParams }: PageProps) {
|
|||||||
|
|
||||||
const tradeWhere = {
|
const tradeWhere = {
|
||||||
OR: [
|
OR: [
|
||||||
{ hashtagId: { not: null }, type: { not: 'LOTTERY_WIN' } },
|
{ hashtagId: { not: null as string | null }, type: { not: 'LOTTERY_WIN' as const } },
|
||||||
{ type: { in: ['FUND_INVEST', 'FUND_REDEEM'] } },
|
{ type: { in: ['FUND_INVEST', 'FUND_REDEEM'] as ('FUND_INVEST' | 'FUND_REDEEM')[] } },
|
||||||
],
|
],
|
||||||
} as const
|
}
|
||||||
|
|
||||||
const [total, trades] = await Promise.all([
|
const [total, trades] = await Promise.all([
|
||||||
prisma.trade.count({ where: tradeWhere }),
|
prisma.trade.count({ where: tradeWhere }),
|
||||||
prisma.trade.findMany({
|
prisma.trade.findMany({
|
||||||
where: tradeWhere,
|
where: {
|
||||||
|
OR: [
|
||||||
|
{ hashtagId: { not: null }, type: { not: 'LOTTERY_WIN' as const } },
|
||||||
|
{ type: { in: ['FUND_INVEST', 'FUND_REDEEM'] as const } },
|
||||||
|
],
|
||||||
|
},
|
||||||
orderBy: { createdAt: 'desc' },
|
orderBy: { createdAt: 'desc' },
|
||||||
take: PAGE_SIZE,
|
take: PAGE_SIZE,
|
||||||
skip: (page - 1) * PAGE_SIZE,
|
skip: (page - 1) * PAGE_SIZE,
|
||||||
|
|||||||
Reference in New Issue
Block a user