This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user