fix: BigInt JSON serialization, pricing table dark mode

- 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) <noreply@anthropic.com>
This commit is contained in:
Ho Ngoc Hai
2026-04-13 11:29:06 +07:00
parent 1ebdc5f0b3
commit f373f7b1e2
2 changed files with 8 additions and 2 deletions

View File

@@ -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';

View File

@@ -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',
)}
>
<span>{t(`tiers.${plan.tier}`)}</span>
@@ -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' ? (