From f373f7b1e241eebc4feac5e3e248a47509ad062c Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Mon, 13 Apr 2026 11:29:06 +0700 Subject: [PATCH] fix: BigInt JSON serialization, pricing table dark mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add BigInt.prototype.toJSON polyfill in main.ts so Express can serialize Prisma BigInt fields (priceVND, revenue amounts) - Fix: admin/moderation and admin/revenue returning 500 Internal Error - Fix pricing compare table: Enterprise column text invisible in dark mode (bg-green-50 without dark variant → add dark:bg-green-950/40) Co-Authored-By: Claude Opus 4 (1M context) --- apps/api/src/main.ts | 6 ++++++ apps/web/app/[locale]/(public)/pricing/page.tsx | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index b1c15a1..09213f6 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -1,5 +1,11 @@ import './instrument'; +// BigInt cannot be serialized by JSON.stringify by default. +// Polyfill toJSON so Express/NestJS can serialize Prisma BigInt fields. +(BigInt.prototype as any).toJSON = function () { + return this.toString(); +}; + import { RequestMethod, ValidationPipe } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; diff --git a/apps/web/app/[locale]/(public)/pricing/page.tsx b/apps/web/app/[locale]/(public)/pricing/page.tsx index b59fd3d..841e70a 100644 --- a/apps/web/app/[locale]/(public)/pricing/page.tsx +++ b/apps/web/app/[locale]/(public)/pricing/page.tsx @@ -525,7 +525,7 @@ export default function PricingPage() { className={cn( 'px-4 py-3 text-center text-sm font-semibold', plan.tier === 'AGENT_PRO' && 'bg-primary/5', - isAuthenticated && plan.tier === currentTier && 'bg-green-50', + isAuthenticated && plan.tier === currentTier && 'bg-green-50 dark:bg-green-950/40', )} > {t(`tiers.${plan.tier}`)} @@ -552,7 +552,7 @@ export default function PricingPage() { className={cn( 'px-4 py-3 text-center text-sm', plan.tier === 'AGENT_PRO' && 'bg-primary/5', - isAuthenticated && plan.tier === currentTier && 'bg-green-50', + isAuthenticated && plan.tier === currentTier && 'bg-green-50 dark:bg-green-950/40', )} > {typeof val === 'boolean' ? (