diff --git a/src/app/trades/page.tsx b/src/app/trades/page.tsx index 150fed2..e3c0305 100644 --- a/src/app/trades/page.tsx +++ b/src/app/trades/page.tsx @@ -17,15 +17,20 @@ export default async function GlobalTradesPage({ searchParams }: PageProps) { const tradeWhere = { OR: [ - { hashtagId: { not: null }, type: { not: 'LOTTERY_WIN' } }, - { type: { in: ['FUND_INVEST', 'FUND_REDEEM'] } }, + { hashtagId: { not: null as string | null }, type: { not: 'LOTTERY_WIN' as const } }, + { type: { in: ['FUND_INVEST', 'FUND_REDEEM'] as ('FUND_INVEST' | 'FUND_REDEEM')[] } }, ], - } as const + } const [total, trades] = await Promise.all([ prisma.trade.count({ where: tradeWhere }), 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' }, take: PAGE_SIZE, skip: (page - 1) * PAGE_SIZE,